From fb242dd109eb4264d2320c6c63867d01b5c25c27 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Mon, 5 Apr 2021 22:49:17 +0200 Subject: [PATCH] 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 --- src/core/gcal-time-zone-monitor.c | 2 ++ 1 file changed, 2 insertions(+) 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)