[evolution-ews/gnome-2-28] Bug #661528 - g_ascii_strcasecmp: assertion `s2 != NULL' failed



commit 6d34a10ea3dbdb7931fe19e6bb787ce852ecd168
Author: Vibha Yadav <yvibha novell com>
Date:   Fri Nov 18 12:02:17 2011 +0530

    Bug #661528 - g_ascii_strcasecmp: assertion `s2 != NULL' failed
    
    Added a check for NULL String before calling to compare.

 src/addressbook/e-book-backend-ews.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index ebe6683..524a40b 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -1022,16 +1022,14 @@ convert_contact_to_updatexml (ESoapMessage *msg, gpointer user_data)
 		if (element_type == ELEMENT_TYPE_SIMPLE)  {
 			value =  e_contact_get (new_contact, mappings[i].field_id);
 			old_value =  e_contact_get (old_contact, mappings[i].field_id);
+			if ((value && !old_value) || (!value && old_value) ||(value && old_value && g_ascii_strcasecmp(value, old_value)))
+				convert_contact_property_to_updatexml(msg, mappings[i].element_name, value, "contacts", NULL, NULL);
 			if (value)
-			{
-				if(( *value && !old_value) || g_ascii_strcasecmp (value, old_value))
-					convert_contact_property_to_updatexml(msg, mappings[i].element_name, value, "contacts", NULL, NULL);
 				g_free(value);
-			}
-			if(old_value)
+			if (old_value)
 				g_free(old_value);
 		} else if (element_type == ELEMENT_TYPE_COMPLEX) {
-			if(mappings [i].field_id == E_CONTACT_UID)
+			if (mappings [i].field_id == E_CONTACT_UID)
 				continue;
 			mappings[i].set_changes (msg, new_contact, old_contact);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]