[evolution-patches] [Fwd: eds/calendar, crash import fix]




i'm not very awake today

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
--- Begin Message ---
while looking at another bug i hit this crash on the first calendar list i tried to import i found on a web page.

it still doesn't import (or at least, if it does i can't find where it went), but at least e-d-s doesn't go into an infinite crash-loop trying to import a calendar file.

so, no idea if this is even closely related ot the right fix.
--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.302
diff -u -3 -r1.302 ChangeLog
--- calendar/ChangeLog	30 Jul 2004 12:30:43 -0000	1.302
+++ calendar/ChangeLog	2 Aug 2004 05:55:19 -0000
@@ -1,3 +1,9 @@
+2004-08-02  Not Zed  <NotZed Ximian com>
+
+	* backends/file/e-cal-backend-file.c
+	(e_cal_backend_file_create_object): don't crash if the component
+	has no uid, create a new one instead.
+
 2004-07-30  Harish Krishnaswamy  <kharish novell com>
 	
 	Fixes #59335
Index: calendar/backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.34
diff -u -3 -r1.34 e-cal-backend-file.c
--- calendar/backends/file/e-cal-backend-file.c	11 Jun 2004 15:54:15 -0000	1.34
+++ calendar/backends/file/e-cal-backend-file.c	2 Aug 2004 05:55:20 -0000
@@ -1652,9 +1652,16 @@
 
 	/* Get the UID */
 	comp_uid = icalcomponent_get_uid (icalcomp);
+	if (comp_uid == NULL) {
+		char *uid = e_cal_component_gen_uid();
 
+		icalcomponent_set_uid(icalcomp, uid);
+		g_free(uid);
+		comp_uid = icalcomponent_get_uid (icalcomp);
+	}
+		
 	/* check the object is not in our cache */
-	if (lookup_component (cbfile, comp_uid)) {
+	if (comp_uid && lookup_component (cbfile, comp_uid)) {
 		icalcomponent_free (icalcomp);
 		return GNOME_Evolution_Calendar_ObjectIdAlreadyExists;
 	}

--- End Message ---


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