diff options
author | Travis Reitter <treitter@gmail.com> | 2010-07-07 03:23:13 +0800 |
---|---|---|
committer | Travis Reitter <treitter@gmail.com> | 2010-07-21 07:12:36 +0800 |
commit | 1acf1e0f3b5686b95f1b0787a5308e0a6298eb08 (patch) | |
tree | 77c63bbecae84316d8e44dbe897aacfea7609ba3 | |
parent | c9602a81b0f64f20c1927947c8e456929c521119 (diff) | |
download | gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar.gz gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar.bz2 gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar.lz gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar.xz gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.tar.zst gsoc2013-empathy-1acf1e0f3b5686b95f1b0787a5308e0a6298eb08.zip |
Add some more validation when sorting the contact list.
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index 398ed1357..b47b310cc 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -1198,6 +1198,8 @@ individual_store_contact_sort (FolksIndividual *individual_a, { gint ret_val; + g_return_val_if_fail (individual_a != NULL || individual_b != NULL, 0); + /* alias */ ret_val = g_utf8_collate (folks_individual_get_alias (individual_a), folks_individual_get_alias (individual_b)); @@ -1241,11 +1243,11 @@ individual_store_state_sort_func (GtkTreeModel *model, EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, &is_separator_b, EMPATHY_INDIVIDUAL_STORE_COL_IS_FAKE_GROUP, &fake_group_b, -1); - ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, - name_a, name_b, individual_a, individual_b, fake_group_a, fake_group_b); - - if (ret_val != 0) + if (individual_a == NULL || individual_b == NULL) { + ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, + name_a, name_b, individual_a, individual_b, fake_group_a, + fake_group_b); goto free_and_out; } @@ -1306,10 +1308,10 @@ individual_store_name_sort_func (GtkTreeModel *model, EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, &is_separator_b, EMPATHY_INDIVIDUAL_STORE_COL_IS_FAKE_GROUP, &fake_group_b, -1); - ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, - name_a, name_b, individual_a, individual_b, fake_group_a, fake_group_b); - - if (ret_val == 0) + if (individual_a == NULL || individual_b == NULL) + ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, + name_a, name_b, individual_a, individual_b, fake_group_a, fake_group_b); + else ret_val = individual_store_contact_sort (individual_a, individual_b); if (individual_a) |