diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-09 15:56:56 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:43 +0800 |
commit | e0f339b781ee043a7a0196d98a87b9750a8fc2fe (patch) | |
tree | 2b17784c4fc1c46e114bf24b3da50ddf00a868ed | |
parent | 7ea1badd8a6e61d727ca7353dd5d34d2735bf067 (diff) | |
download | gsoc2013-evolution-e0f339b781ee043a7a0196d98a87b9750a8fc2fe.tar.gz gsoc2013-evolution-e0f339b781ee043a7a0196d98a87b9750a8fc2fe.tar.zst gsoc2013-evolution-e0f339b781ee043a7a0196d98a87b9750a8fc2fe.zip |
Bug #637641 - Crash on audio alarms with invalid file URI set
-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) |