From 1308e33f1d1ad82d632ad9914ce22e1b1fb66e64 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 9 Oct 2019 12:15:45 -0300 Subject: [PATCH] manager: Always return if calendar creation fails This is an embarrassing mistake: when an error is propagated, we always need to return! The error matching should only be used for deciding whether to warn or not. https://gitlab.gnome.org/GNOME/gnome-calendar/issues/470 https://gitlab.gnome.org/GNOME/gnome-calendar/issues/264 --- src/core/gcal-manager.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/gcal-manager.c b/src/core/gcal-manager.c index 2da93204..795e718d 100644 --- a/src/core/gcal-manager.c +++ b/src/core/gcal-manager.c @@ -258,11 +258,13 @@ on_calendar_created_cb (GObject *source_object, self = GCAL_MANAGER (user_data); calendar = gcal_calendar_new_finish (result, &error); - if (error && - !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && - !g_error_matches (error, GCAL_CALENDAR_ERROR, GCAL_CALENDAR_ERROR_NOT_CALENDAR)) + if (error) { - g_warning ("Failed to open/connect to calendar: %s", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && + !g_error_matches (error, GCAL_CALENDAR_ERROR, GCAL_CALENDAR_ERROR_NOT_CALENDAR)) + { + g_warning ("Failed to open/connect to calendar: %s", error->message); + } return; }