diff options
author | Milan Crha <mcrha@redhat.com> | 2012-01-17 02:25:37 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-01-17 02:25:37 +0800 |
commit | 8b8f564a639cef32ecc6b85a34dfee77bfba79c5 (patch) | |
tree | 80e9587cc48cf9d4129bd740dad36cb4fb47ad9b | |
parent | abdb42a271f8680a1b26fc258c41f6679ef10b93 (diff) | |
download | gsoc2013-evolution-8b8f564a639cef32ecc6b85a34dfee77bfba79c5.tar.gz gsoc2013-evolution-8b8f564a639cef32ecc6b85a34dfee77bfba79c5.tar.zst gsoc2013-evolution-8b8f564a639cef32ecc6b85a34dfee77bfba79c5.zip |
Bug #667741 - Crash when browse for CalDAV calendar
-rw-r--r-- | plugins/caldav/caldav-browse-server.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index e2cce51de6..e1384ce062 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -1444,6 +1444,8 @@ init_dialog (GtkDialog *dialog, } soup_uri = soup_uri_new (url); + g_return_if_fail (soup_uri != NULL); + soup_uri_set_scheme (soup_uri, "caldav"); soup_uri_set_user (soup_uri, username); @@ -1576,17 +1578,25 @@ caldav_browse_server (GtkWindow *parent, { GtkWidget *dialog, *new_url_entry, *new_usermail_combo, *new_autoschedule_check; gchar *url, *new_url = NULL; + SoupURI *soup_uri = NULL; + g_return_val_if_fail (server_url != NULL, NULL); url = prepare_url (server_url, use_ssl); + if (url && *url) + soup_uri = soup_uri_new (url); - if (!url || !*url) { + if (!url || !*url || !soup_uri) { e_notice (parent, GTK_MESSAGE_ERROR, _("Server URL '%s' is not a valid URL"), server_url); + if (soup_uri) + soup_uri_free (soup_uri); g_free (url); return NULL; } + soup_uri_free (soup_uri); + dialog = gtk_dialog_new_with_buttons ( _("Browse for a CalDAV calendar"), parent, |