From 81be4634777d39411437c1e7c516a63365452418 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Wed, 29 Sep 2004 19:21:11 +0000 Subject: Fixes bug #65537. 2004-09-29 Hans Petter Jansson Fixes bug #65537. * gui/merging/eab-contact-compare.c (query_cb): Protect against NULL UIDs, and make fewer calls to e_contact_get_const () as a bonus. svn path=/trunk/; revision=27428 --- addressbook/ChangeLog | 7 +++++++ addressbook/gui/merging/eab-contact-compare.c | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index eb3e556e49..09891b18a9 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2004-09-29 Hans Petter Jansson + + Fixes bug #65537. + + * gui/merging/eab-contact-compare.c (query_cb): Protect against NULL + UIDs, and make fewer calls to e_contact_get_const () as a bonus. + 2004-09-24 Hao Sheng Fix for #66523 diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index bc68784ed7..4244f3fbff 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -613,11 +613,22 @@ query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure) /* remove the contacts we're to avoid from the list, if they're present */ for (i = contacts; i != NULL; i = g_list_next (i)) { EContact *this_contact = E_CONTACT (i->data); + const gchar *this_uid; GList *iterator; gboolean avoid = FALSE; + + this_uid = e_contact_get_const (this_contact, E_CONTACT_UID); + if (!this_uid) + continue; + for (iterator = info->avoid; iterator; iterator = iterator->next) { - if (!strcmp (e_contact_get_const (iterator->data, E_CONTACT_UID), - e_contact_get_const (this_contact, E_CONTACT_UID))) { + const gchar *avoid_uid; + + avoid_uid = e_contact_get_const (iterator->data, E_CONTACT_UID); + if (!avoid_uid) + continue; + + if (!strcmp (avoid_uid, this_uid)) { avoid = TRUE; break; } -- cgit v1.2.3