bitfireAT/ical4android

Exception when unknown timezone in calendar provider

Closed this issue · 0 comments

See bitfireAT/davx5-ose#133: when an event in the calendar provider contains an unknown time zone, for instance Europe/Kyiv (the newer version of Europe/Kiev), AndroidEvent.populateEvent throws an unhandled Exception:

j$.time.zone.c: Unknown time-zone ID: Europe/Kyiv
	at j$.time.zone.f.b(SourceFile:2)
	at j$.time.u.Q(SourceFile:3)
	at j$.time.ZoneId.L(SourceFile:2)
	at j$.time.ZoneId.of(Unknown Source:1)
	at at.bitfire.ical4android.util.TimeApiExtensions.toZoneIdCompat(Unknown Source:9)
	at at.bitfire.ical4android.util.TimeApiExtensions.requireZoneId(TimeApiExtensions.kt:3)
	at at.bitfire.ical4android.util.TimeApiExtensions.toZonedDateTime(Unknown Source:13)
	at at.bitfire.ical4android.AndroidEvent.populateEvent(AndroidEvent.kt:29)

This should be handled somehow; for instance by choosing the system default timezone as a last resort (the calendar provider stores the UNIX time of dtStart/dtEnd in any case, so this should be possible without losing the actual time).