From 46e6fb3e66990e0eef417121df9bc2fc71d7f4ca Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Mon, 10 Feb 2003 21:49:11 +0000 Subject: Don't try to make an error string from an uninitialized GnomeVFSResult. 2003-02-10 Hans Petter Jansson * pcs/cal-backend-file.c (save): Don't try to make an error string from an uninitialized GnomeVFSResult. svn path=/trunk/; revision=19880 --- calendar/ChangeLog | 5 +++++ calendar/pcs/cal-backend-file.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index ea0df608cc..8c36fc332e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2003-02-10 Hans Petter Jansson + + * pcs/cal-backend-file.c (save): Don't try to make an error string + from an uninitialized GnomeVFSResult. + 2003-02-10 Ettore Perazzoli * gui/Makefile.am: Make the CORBA IDL compilation work with diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c index 242904fb48..a0d9453b3b 100644 --- a/calendar/pcs/cal-backend-file.c +++ b/calendar/pcs/cal-backend-file.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "e-util/e-dbhash.h" #include "cal-util/cal-recur.h" @@ -247,13 +248,13 @@ save (CalBackendFile *cbfile) uri = gnome_vfs_uri_new (priv->uri); if (!uri) - goto error; + goto error_malformed_uri; /* save calendar to backup file */ tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE); if (!tmp) { gnome_vfs_uri_unref (uri); - goto error; + goto error_malformed_uri; } backup_uristr = g_strconcat (tmp, "~", NULL); @@ -264,7 +265,7 @@ save (CalBackendFile *cbfile) if (!backup_uri) { gnome_vfs_uri_unref (uri); - goto error; + goto error_malformed_uri; } result = gnome_vfs_create_uri (&handle, backup_uri, @@ -294,7 +295,12 @@ save (CalBackendFile *cbfile) goto error; return; - + + error_malformed_uri: + cal_backend_notify_error (CAL_BACKEND (cbfile), + _("Can't save calendar data: Malformed URI.")); + return; + error: cal_backend_notify_error (CAL_BACKEND (cbfile), gnome_vfs_result_to_string (result)); return; -- cgit v1.2.3