diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-09 15:56:56 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-03-09 15:56:56 +0800 |
commit | cc4dd64854e652e4f6c8552069977088c87268bb (patch) | |
tree | 6a7d6db8566bac452514214d1f0fa5a4a9cfe856 /calendar/gui | |
parent | e9f08a79f5db23ed5475f7cb26afc0de580f492f (diff) | |
download | gsoc2013-evolution-cc4dd64854e652e4f6c8552069977088c87268bb.tar.gz gsoc2013-evolution-cc4dd64854e652e4f6c8552069977088c87268bb.tar.zst gsoc2013-evolution-cc4dd64854e652e4f6c8552069977088c87268bb.zip |
Bug #637641 - Crash on audio alarms with invalid file URI set
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 3f8cccb716..4f3233501c 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1690,25 +1690,28 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, if (attach && icalattach_get_is_url (attach)) { const gchar *url; - gchar *filename; - GError *error = NULL; url = icalattach_get_url (attach); - filename = g_filename_from_uri (url, NULL, &error); + if (url && *url) { + gchar *filename; + GError *error = NULL; - if (error != NULL) { - g_warning ("%s: %s", G_STRFUNC, error->message); - g_error_free (error); - } else if (g_file_test (filename, G_FILE_TEST_EXISTS)) { - flag = 1; + filename = g_filename_from_uri (url, NULL, &error); + + if (error != NULL) { + g_warning ("%s: %s", G_STRFUNC, error->message); + g_error_free (error); + } else if (filename && g_file_test (filename, G_FILE_TEST_EXISTS)) { #ifdef HAVE_CANBERRA - ca_context_play ( - ca_gtk_context_get (), 0, - CA_PROP_MEDIA_FILENAME, filename, NULL); + flag = 1; + ca_context_play ( + ca_gtk_context_get (), 0, + CA_PROP_MEDIA_FILENAME, filename, NULL); #endif - } + } - g_free (filename); + g_free (filename); + } } if (!flag) |