[gnome-calendar/gnome-3-34] manager: Always return if calendar creation fails
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-34] manager: Always return if calendar creation fails
- Date: Wed, 9 Oct 2019 16:06:53 +0000 (UTC)
commit 3b3c6016eb679fdf5b5e8c8a77c79c4edb105c49
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 9 12:15:45 2019 -0300
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]