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

Fix ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 #4985

Open
wants to merge 1 commit into
base: master
from

Conversation

@Athameon
Copy link

@Athameon Athameon commented Aug 30, 2020

ArrayIndexOutOfBoundsException is thrown and whole app crashes if a a marked BarCharts get outside of the visible range.
The exception can be caught and logged without a disadvantage.

PR Checklist:

  • I have tested this extensively and it does not break any existing behavior.
  • I have added/updated examples and tests for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: #4984

PR Description

The "e.getRanges()[high.getStackIndex()]" gets surrounded with a try - catch. If an exception is thrown, the method returns without any change.

Catches exception if a marked BarChart gets outside of the visible chart area.

The whole app crashes if this exception is not caught.

ArrayIndexOutOfBoundsException is thrown and whole app crashes if a a marked BarCharts get outside of the visible range.
@Athameon Athameon changed the title Update BarChartRenderer.java Fixe bug https://github.com/PhilJay/MPAndroidChart/issues/4984 in BarChartRenderer.java Aug 30, 2020
@Athameon Athameon changed the title Fixe bug https://github.com/PhilJay/MPAndroidChart/issues/4984 in BarChartRenderer.java Fixe bug ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Aug 30, 2020
@Athameon Athameon changed the title Fixe bug ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Fix ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Aug 30, 2020
@Athameon Athameon closed this Nov 14, 2020
@Athameon Athameon reopened this Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.