badoualy / datepicker-timeline

An infinite scrolling timeline to pick a date
MIT License
464 stars 71 forks source link

StringIndexOutOfBoundsException on MonthView #20

Closed MrHadiSatrio closed 6 years ago

MrHadiSatrio commented 6 years ago

Recently, my app has reported a significant number of crashes that was caused by StringIndexOutOfBoundsException from within this library's MonthView.

The crash logs have led me here:

String text = MONTHS[month].substring(0, 3).toUpperCase(Locale.US);

It's an early guess, but it seems like there is a possibility for MONTHS[month] to be less than 3 in length. Hence the error.

badoualy commented 6 years ago

Dupe of #12 I'll try to fix ASAP, feel free to make a PR if you have the time

MrHadiSatrio commented 6 years ago

Oops, sorry, had no idea. I didn't suspect it has relation to the activity lifecycle / restore mechanism.

I'll try to come up with something. In the mean time, could you please review my existing PR #18? Thanks!

badoualy commented 6 years ago

It doesn't, just the same bug :)

Will check