[evolution] icalendar-importer: Fix a crash when importing with no existing cals



commit d6e2d993bba77ad5965961c534ffe73cae39511a
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Fri Nov 29 11:25:34 2013 +0000

    icalendar-importer: Fix a crash when importing with no existing cals
    
    This is a theoretical crash (not actually reproduced) caused by calling
    g_object_ref(source) when source is NULL, which can happen if no
    calendars or task lists exist.
    
    This fixes the crash, but there may be UI bugs if this condition is
    reached.
    
    Found by scan-build.
    
    https://bugzilla.gnome.org/719540

 calendar/importers/icalendar-importer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 83fc952..5c670cf 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -363,7 +363,7 @@ ivcal_getwidget (EImport *ei,
 
                if (!group)
                        group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb));
-               if (first == NULL) {
+               if (first == NULL && source != NULL) {
                        g_datalist_set_data_full (&target->data, "primary-source", g_object_ref (source), 
g_object_unref);
                        g_datalist_set_data (&target->data, "primary-type", GINT_TO_POINTER 
(import_type_map[i]));
                        first = rb;


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