Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ArrayIndexOutOfBoundsException: EventRecurrenceFormatter.java:110 #282

Closed
mtrakal opened this issue May 13, 2016 · 7 comments
Closed

Comments

@mtrakal
Copy link
Contributor

mtrakal commented May 13, 2016

Latest 2.5.3 version:

For some users it crash on this after update lib. It's from crashlytics, so I'm sorry I doesn't have more info :/

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=5; index=-2
       at com.codetroopers.betterpickers.recurrencepicker.EventRecurrenceFormatter.getRepeatString(EventRecurrenceFormatter.java:110)
@fchauveau
Copy link
Member

Hi @mtrakal,
Can you have language of user? This may help.

@mtrakal
Copy link
Contributor Author

mtrakal commented May 17, 2016

Looks like Spain with es, English (Switzerland with en, USA with en). We are using more translations (to support more langs), but every looks OK. Has same rows (5) as it is said in exception.

But it looks on problem with index -2, not with arrays in strings.

Ok, I try to reproduce and it is by set value: bundle.putLong(RecurrencePickerDialogFragment.BUNDLE_START_TIME_MILLIS, LAST_SUNDAY_OF_MONTH.getMillis());

click on Monthly, select: every last sunday.

When I click OK, code go to: EventRecurrenceFormatter.java:110 and dayNumber is set to -1.
So it try to get: mMonthRepeatByDayOfWeekStrs[6][-2];

recurrence.bydayNum[0] is -1, but should be: 4, for my condition.

It's independant on lang, it depends on selected start day

@mtrakal
Copy link
Contributor Author

mtrakal commented May 17, 2016

clipboard01

@mtrakal
Copy link
Contributor Author

mtrakal commented May 17, 2016

clipboard02

@fchauveau
Copy link
Member

Hey @mtrakal
Can you have give a try to https://github.com/code-troopers/android-betterpickers/tree/fix/282
I think it's correctly fix this issue, but if you can try it before i release it.

Thx

@mtrakal
Copy link
Contributor Author

mtrakal commented May 18, 2016

Looks fixed 👍

fchauveau added a commit that referenced this issue May 19, 2016
fix #282 : Recurrence NPE on selected monthly recurrency + any last w…
@fchauveau
Copy link
Member

fixed in 2.5.5, release in progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants