summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Keller <skeller@gnome.org>2021-04-05 22:49:17 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2021-04-11 00:27:08 +0000
commitfb242dd109eb4264d2320c6c63867d01b5c25c27 (patch)
treed137f45c6fbcc27325ad0cac7cb606249327f770
parenta0d24cd5d8f69a9b8e15b5bb1084639db4426f1b (diff)
downloadgnome-calendar-fb242dd109eb4264d2320c6c63867d01b5c25c27.tar.gz
time-zone-monitor: Use local timezone as fallback without dbus service
On systems without anything providing the org.freedesktop.timedate1 interface, the timezone returned by the monitor would always be NULL, because it was never set. This can lead to crashes in places that expect the monitor to always return a valid timezone. So in that case use the local timezone from when the monitor got initialized. Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/703
-rw-r--r--src/core/gcal-time-zone-monitor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/gcal-time-zone-monitor.c b/src/core/gcal-time-zone-monitor.c
index 745a71d6..d82bf8f0 100644
--- a/src/core/gcal-time-zone-monitor.c
+++ b/src/core/gcal-time-zone-monitor.c
@@ -139,6 +139,8 @@ gcal_time_zone_monitor_init (GcalTimeZoneMonitor *self)
GCAL_ENTRY;
+ self->timezone = g_time_zone_new_local ();
+
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
if (!connection)