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
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
a0d24cd5d8
commit
fb242dd109
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user