? depcomp
? fix-316315.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.411
diff -u -p -r1.411 ChangeLog
--- ChangeLog	18 Nov 2005 10:13:28 -0000	1.411
+++ ChangeLog	23 Nov 2005 09:19:20 -0000
@@ -1,3 +1,12 @@
+2005-11-23  Veerapuram Varadhan <vvaradhan@novell.com>
+
+	* calendar/e-cal-backend-exchange.c: (match_object_sexp)
+	(check_change_type): Calendar components that are just instances
+	and without master object, don't have corresponding
+	icalcomponent. Check for the existence of icalcomponent before
+	adding them to the change list.
+	** Fixes #316315
+	
 2005-11-14  Sarfraaz Ahmed <asarfraaz@novell.com>
 
 	* configure.in : Bumped the version to 2.5.2
Index: calendar/e-cal-backend-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/calendar/e-cal-backend-exchange.c,v
retrieving revision 1.44
diff -u -p -r1.44 e-cal-backend-exchange.c
--- calendar/e-cal-backend-exchange.c	21 Oct 2005 11:52:22 -0000	1.44
+++ calendar/e-cal-backend-exchange.c	23 Nov 2005 09:19:20 -0000
@@ -806,7 +806,17 @@ match_object_sexp (gpointer key, gpointe
 	ECalBackendExchangeComponent *ecomp = value;
 	MatchObjectData *match_data = data;
 	ECalComponent *comp;
-	
+
+	/* 
+	   In case of detached instances with no master object,
+	   ecomp->icomp will be NULL and hence should be skipped
+	   from matching.
+	   FIXME: However, instances are still valid and should be
+	   matched. 
+	*/
+	if (!ecomp || !ecomp->icomp)
+		return;
+
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (ecomp->icomp));
 
@@ -1270,28 +1280,34 @@ check_change_type (gpointer key, gpointe
 	ECalComponent *comp;
 	char *uid = key;
 	
-	if (ecomp != NULL) {
+	/* 
+	   In case of detached instances with no master object,
+	   ecomp->icomp will be NULL and hence should be skipped
+	   from matching.
+	   FIXME: However, instances are still valid and should be
+	   matched. 
+	*/
+	if (!ecomp || !ecomp->icomp)
+		return;
 
-		comp = e_cal_component_new ();
-		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (ecomp->icomp));
+	comp = e_cal_component_new ();
+	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (ecomp->icomp));
 
-		calobj = e_cal_component_get_as_string (comp);
-		switch (e_xmlhash_compare (change_data->ehash, uid, calobj)){
-		case E_XMLHASH_STATUS_SAME:
-			break;
-		case E_XMLHASH_STATUS_NOT_FOUND:
-			change_data->adds = g_list_prepend (change_data->adds, g_strdup (calobj));
-			e_xmlhash_add (change_data->ehash, uid, calobj);
-			break;
-		case E_XMLHASH_STATUS_DIFFERENT:
-			change_data->modifies = g_list_prepend (change_data->modifies, g_strdup (calobj));
-			e_xmlhash_add (change_data->ehash, uid, calobj);
-		}
-		
-		g_free (calobj);
-		g_object_unref (comp);
+	calobj = e_cal_component_get_as_string (comp);
+	switch (e_xmlhash_compare (change_data->ehash, uid, calobj)){
+	case E_XMLHASH_STATUS_SAME:
+		break;
+	case E_XMLHASH_STATUS_NOT_FOUND:
+		change_data->adds = g_list_prepend (change_data->adds, g_strdup (calobj));
+		e_xmlhash_add (change_data->ehash, uid, calobj);
+		break;
+	case E_XMLHASH_STATUS_DIFFERENT:
+		change_data->modifies = g_list_prepend (change_data->modifies, g_strdup (calobj));
+		e_xmlhash_add (change_data->ehash, uid, calobj);
 	}
 		
+	g_free (calobj);
+	g_object_unref (comp);		
 }
 
 struct cbe_data {
