summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-02-18 15:46:24 +0000
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-02-18 17:14:19 -0600
commit23c7edd230c17eebe1fd2b0a6fb6444995934160 (patch)
treea010b4c2ab7329cda8cca81007a96e1e5ec4d93f
parent94a9fa2c7f5d593fe4350a18db962af751bf1c20 (diff)
downloadgnome-calendar-mcatanzaro/#485-gnome-3-34.tar.gz
date-time-utils: fall back to UTC when timezone is unrecognizedmcatanzaro/#485-gnome-3-34
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
-rw-r--r--src/utils/gcal-date-time-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/gcal-date-time-utils.c b/src/utils/gcal-date-time-utils.c
index 11dcb5a8..ea28f072 100644
--- a/src/utils/gcal-date-time-utils.c
+++ b/src/utils/gcal-date-time-utils.c
@@ -246,7 +246,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;
}