Fix for the bug #330842 [calendar]

pchenthill <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <[email protected]>
Hi,
    Have attached the fix for the bug. Check if the icalcomponent is set
in the ECalcomponent before accessing the value from it.

thanks, Chenthill

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
330842.diff (text/x-patch, 1.4 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.3013
diff -u -p -r1.3013 ChangeLog
--- ChangeLog	20 Mar 2006 06:19:42 -0000	1.3013
+++ ChangeLog	20 Mar 2006 21:21:54 -0000
@@ -1,3 +1,10 @@
+2006-03-21  Chenthill Palanisamy  <[email protected]>
+
+	Fixes #330842
+	* gui/e-cal-model.c: 
+	(e_cal_view_objects_added_cb): Check if the icalcomp
+	is set to ECalComponent.
+
 2006-03-20  Boby Wang <[email protected]>
 
 	** Fix for bug #268584
Index: gui/e-cal-model.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model.c,v
retrieving revision 1.71
diff -u -p -r1.71 e-cal-model.c
--- gui/e-cal-model.c	13 Mar 2006 05:34:08 -0000	1.71
+++ gui/e-cal-model.c	20 Mar 2006 21:22:01 -0000
@@ -1359,7 +1359,12 @@ e_cal_view_objects_added_cb (ECalView *q
 		ECalComponent *comp = e_cal_component_new ();
 		ECal *client = e_cal_view_get_client (query);
 
-		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data));
+		/* This will fail for alarm or VCalendar component */
+		if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data))) {
+			g_object_unref (comp);
+			continue;
+		}
+
 		id = e_cal_component_get_id (comp);
 
 		/* remove the components if they are already present and re-add them */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.