[evolution-data-server/gnome-3-0] bug #628684 groupwise critical warnings
- From: Punit Jain <jpunit src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-0] bug #628684 groupwise critical warnings
- Date: Tue, 17 May 2011 15:24:34 +0000 (UTC)
commit d3f26226ca5e8fab4d62ee7db0a92fe3e2f99d56
Author: Punit Jain <jpunit novell com>
Date: Tue May 17 20:53:08 2011 +0530
bug #628684 groupwise critical warnings
.../backends/groupwise/e-book-backend-groupwise.c | 18 +++++++++++-------
servers/groupwise/e-gw-item.c | 3 ++-
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 3fc997e..b9a5fbe 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 7b1f952..a573848 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]