codinguser / gnucash-android

Gnucash for Android mobile companion application.
Apache License 2.0
1.23k stars 540 forks source link

Crash when scrolling bar chart view #801

Closed utzcoz closed 5 years ago

utzcoz commented 5 years ago

Steps to reproduce the behaviour

  1. Make sure some transaction data in your account.
  2. Enter report page and select bar chart.
  3. Scroll bar chart view after data showed.

Expected behaviour

The bar chart will scroll and show the transaction name/category to me.

Actual behaviour

The app crashed.

Software specifications

I have dig into the crash log, and found that this is a bug of MPAndroidChart. The method getClosestStackIndex of com.github.mikephil.charting.highlight.BarHighlighter.java in MPAndroidChart with version v2.1.3, doesn't process the occasion that the length of input parameter range is 0. And then I viewed the current code in MPAndroidChart, and found they have fixed this bug two years ago. Maybe upgrade MPAndroidChart can fix this bug.

Oh, upgrading dependency directly will cause building error, because of the API changing.

Thanks.