summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPunit Jain <jpunit@novell.com>2011-05-17 20:53:08 +0530
committerPunit Jain <jpunit@novell.com>2011-05-17 20:53:08 +0530
commitd3f26226ca5e8fab4d62ee7db0a92fe3e2f99d56 (patch)
treecfb5dbd63d302f7ba19c64450e71d93c9459c465
parent39d49903230cc1e106289709fad482c10f4baabb (diff)
downloadevolution-data-server-d3f26226ca5e8fab4d62ee7db0a92fe3e2f99d56.tar.gz
bug #628684 groupwise critical warnings
-rw-r--r--addressbook/backends/groupwise/e-book-backend-groupwise.c18
-rw-r--r--servers/groupwise/e-gw-item.c3
2 files changed, 13 insertions, 8 deletions
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index 3fc997e0a..b9a5fbef2 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -1141,9 +1141,7 @@ fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categor
gint element_type;
gint i;
gboolean is_contact_list;
- gboolean is_organization;
- is_organization = e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_ORGANISATION ? TRUE: FALSE;
is_contact_list = e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_GROUP ? TRUE: FALSE;
e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (is_contact_list));
@@ -1155,11 +1153,9 @@ fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categor
if (element_type == ELEMENT_TYPE_SIMPLE) {
if (mappings[i].field_id != E_CONTACT_BOOK_URI) {
- if (!is_organization) {
- value = e_gw_item_get_field_value (item, mappings[i].element_name);
- if (value != NULL)
- e_contact_set (contact, mappings[i].field_id, value);
- }
+ value = e_gw_item_get_field_value (item, mappings[i].element_name);
+ if (value != NULL)
+ e_contact_set (contact, mappings[i].field_id, value);
}
} else if (element_type == ELEMENT_TYPE_COMPLEX) {
if (mappings[i].field_id == E_CONTACT_CATEGORIES) {
@@ -2686,6 +2682,14 @@ build_cache (EBookBackendGroupwise *ebgw)
contact = e_contact_new ();
fill_contact_from_gw_item (contact, E_GW_ITEM (l->data),
ebgw->priv->categories_by_id);
+
+ if (!e_contact_get_const (contact, E_CONTACT_UID)) {
+ g_object_unref (contact);
+ g_object_unref (l->data);
+ g_warning ("found a contact with null uid");
+ continue;
+ }
+
e_contact_set (contact, E_CONTACT_BOOK_URI, priv->original_uri);
e_book_backend_db_cache_add_contact (ebgw->priv->file_db, contact);
e_book_backend_summary_add_contact (ebgw->priv->summary, contact);
diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c
index 7b1f952e7..a5738486f 100644
--- a/servers/groupwise/e-gw-item.c
+++ b/servers/groupwise/e-gw-item.c
@@ -1345,7 +1345,8 @@ set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
member->id = id;
member->email = email;
second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "name");
- member->name = soup_soap_parameter_get_string_value (second_level_child);
+ if (second_level_child)
+ member->name = soup_soap_parameter_get_string_value (second_level_child);
item->priv->member_list = g_list_append (item->priv->member_list, member);
} else {
g_free (id);