aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2005-02-16 06:14:46 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-02-16 06:14:46 +0800
commit593cd183ee41d578168cbcd09743c538866e8637 (patch)
tree5596c2b11db1adfd0c79def4f5f9d5913fd48802
parentce4204497f85f7f4f1522ec91b1716c81cad5800 (diff)
downloadgsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar.gz
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar.bz2
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar.lz
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar.xz
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.tar.zst
gsoc2013-evolution-593cd183ee41d578168cbcd09743c538866e8637.zip
check return value from e_cal_new, to display a better warning message.
2005-02-15 Rodrigo Moya <rodrigo@novell.com> * gui/migration.c (migrate_ical_folder_to_source): check return value from e_cal_new, to display a better warning message. svn path=/trunk/; revision=28800
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/migration.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c31f1af71f..d90a7e5920 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-15 Rodrigo Moya <rodrigo@novell.com>
+
+ * gui/migration.c (migrate_ical_folder_to_source): check return value
+ from e_cal_new, to display a better warning message.
+
2005-02-11 Rodrigo Moya <rodrigo@novell.com>
Fixes #72038
diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c
index 76b8a52a16..fb8f0b2f8c 100644
--- a/calendar/gui/migration.c
+++ b/calendar/gui/migration.c
@@ -318,14 +318,20 @@ migrate_ical_folder_to_source (char *old_path, ESource *new_source, ECalSourceTy
dialog_set_folder_name (e_source_peek_name (new_source));
- old_ecal = e_cal_new (old_source, type);
+ if (!(old_ecal = e_cal_new (old_source, type))) {
+ g_warning ("could not find a backend for '%s'", e_source_get_uri (old_source));
+ goto finish;
+ }
if (!e_cal_open (old_ecal, TRUE, &error)) {
g_warning ("failed to load source ecal for migration: '%s' (%s)", error->message,
e_source_get_uri (old_source));
goto finish;
}
- new_ecal = e_cal_new (new_source, type);
+ if (!(new_ecal = e_cal_new (new_source, type))) {
+ g_warning ("could not find a backend for '%s'", e_source_get_uri (new_source));
+ goto finish;
+ }
if (!e_cal_open (new_ecal, FALSE, &error)) {
g_warning ("failed to load destination ecal for migration: '%s' (%s)", error->message,
e_source_get_uri (new_source));
@@ -336,7 +342,8 @@ migrate_ical_folder_to_source (char *old_path, ESource *new_source, ECalSourceTy
finish:
g_clear_error (&error);
- g_object_unref (old_ecal);
+ if (old_ecal)
+ g_object_unref (old_ecal);
g_object_unref (group);
if (new_ecal)
g_object_unref (new_ecal);