[evolution-ews] Avoid crash on receiving NULL create item.



commit 8ecd1fe1e21a67d16a6da1cb8973583cec415c87
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon Aug 1 13:21:28 2011 +0100

    Avoid crash on receiving NULL create item.
    
    This happens when we receive an item type that we don't understand, such
    as <PostItem>. We shouldn't crash.

 src/camel/camel-ews-folder.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index eb91a72..02d57b7 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -898,9 +898,14 @@ sync_created_items (CamelEwsFolder *ews_folder, EEwsConnection *cnc, GSList *cre
 
 	for (l = created_items; l != NULL; l = g_slist_next (l)) {
 		EEwsItem *item = (EEwsItem *) l->data;
-		const EwsId *id = e_ews_item_get_id (item);
-		EEwsItemType item_type = e_ews_item_get_item_type (item);
+		const EwsId *id;
+		EEwsItemType item_type;
+
+		if (!item)
+			continue;
 
+		id = e_ews_item_get_id (item);
+		item_type = e_ews_item_get_item_type (item);
 		/* created_msg_ids are items other than generic item. We fetch them
 		   separately since the property sets vary */
 		/* FIXME: Do we need to handle any other item types



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