[gnome-calendar/gnome-3-34] manager: Only remove connected calendars
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-34] manager: Only remove connected calendars
- Date: Wed, 9 Oct 2019 16:07:13 +0000 (UTC)
commit 8cb818f4d94533846ac0567738da93f4658dd053
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 9 13:02:35 2019 -0300
manager: Only remove connected calendars
The "source-removed" signal can pass any kind of source,
including source collections that even have the calendar
extension, but are not connected.
src/core/gcal-manager.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/core/gcal-manager.c b/src/core/gcal-manager.c
index c5ba0432..afbdacbf 100644
--- a/src/core/gcal-manager.c
+++ b/src/core/gcal-manager.c
@@ -165,11 +165,15 @@ remove_source (GcalManager *self,
g_return_if_fail (GCAL_IS_MANAGER (self));
g_return_if_fail (E_IS_SOURCE (source));
+ calendar = g_hash_table_lookup (self->clients, source);
+
+ if (!calendar)
+ return;
+
GCAL_TRACE_MSG ("Removing calendar %s (%s)",
e_source_get_display_name (source),
e_source_get_uid (source));
- calendar = g_hash_table_lookup (self->clients, source);
g_object_ref (calendar);
e_cal_data_model_remove_client (self->e_data_model,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]