Ignore empty X-APPLE-CALENDAR-COLOR
Closed this issue · 4 comments
nmxcgeo commented
Hi,
using ICSx⁵ I got the following exception
length=0; index=0
java.lang.StringIndexOutOfBoundsException: length=0; index=0
at java.lang.String.charAt(Native Method)
at android.graphics.Color.parseColor(Color.java:1384)
at at.bitfire.ical4android.Css3Color$Companion.colorFromString(Css3Color.kt:178)
at at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel$initialize$downloader$1.onSuccess(AddCalendarValidationFragment.kt:126)
at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork$icsx5_62_2_0_2_standardRelease(CalendarFetcher.kt:155)
at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:46)
at java.lang.Thread.run(Thread.java:784)
which I think might come from the line X-APPLE-CALENDAR-COLOR:
(value is empty) in my ics-file.
I suspect that Color.parseColor(…)
not only throws IllegalArgumentException
as caught in Css3Color line 189, but also StringIndexOutOfBoundsException
for empty strings.
If necessary I will try to assemble a minimum working example.
Greetings Nmxcgeo
rfc2822 commented
Thanks. Ignoring this invalid field sounds reasonable but I also think the original file should be fixed. Can you do that?
nmxcgeo commented
I will try, it's not directly under my control and I wasn't able to find out what i standard conformant.
nmxcgeo commented
The current release of DAVx⁵ has this included and accepts the problematic calendar. 🥳
Thanks everyone.