diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-11-29 19:25:34 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-12-04 21:19:13 +0800 |
commit | d6e2d993bba77ad5965961c534ffe73cae39511a (patch) | |
tree | b6ba211c3df1513f8b36faca4d1be77bd0c710ae | |
parent | 7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f (diff) | |
download | gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar.gz gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar.bz2 gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar.lz gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar.xz gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.tar.zst gsoc2013-evolution-d6e2d993bba77ad5965961c534ffe73cae39511a.zip |
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
-rw-r--r-- | 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 83fc9521c0..5c670cf943 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; |