date-time-utils: fall back to UTC when timezone is unrecognized

For whatever reason, libical doesn't support the Etc/UTC timezone.
Currently we crash gnome-calendar whenever libical doesn't support the
current timezone (as returned by GTimeZone). Let's fall back to UTC
instead.

Fixes #485
This commit is contained in:
Michael Catanzaro
2020-02-18 17:07:55 -06:00
parent 20509d2ac8
commit a439fd2b1d
+3 -1
View File
@@ -249,7 +249,9 @@ gcal_timezone_to_icaltimezone (GTimeZone *tz)
tzid = g_time_zone_get_identifier (tz);
ical_tz = i_cal_timezone_get_builtin_timezone (tzid);
g_assert (ical_tz != NULL);
if (!ical_tz)
ical_tz = i_cal_timezone_get_utc_timezone ();
return ical_tz;
}