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

Fixed IndexOutOfBoundsException in MaterialCollapsible #1028

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dieterblancke
Copy link

@dieterblancke dieterblancke commented Aug 18, 2022

This should fix an IndexOutOfBoundsException that occurs when executing setActive with an index equal to the amount of widgets.

This error started occuring since this commit afaik: 60d3d21

@dieterblancke
Copy link
Author

@kevzlou7979 if you are able to, please clarify as to what the intention is here.

From the issue #998 it seems like it's now intended to have a 0-based index, yet the log message is still there and there is a check for > 0.

Yet by allowing index <= getWidgetCount(), it can also have an IndexOutOfBoundsException when the index == count (the issue we're running into).

It's fixable by either changing the index <= getWidgetCount() to index < getWidgetCount() and changing the index > 0 to index >= 0 or by reverting to a 1-based index.

Feel free to clarify, and I will update the pull request accordingly 😊

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

Successfully merging this pull request may close these issues.

None yet

1 participant