GnuCash-Pocket / gnucash-android

GnuCash Pocket – a mobile companion app for Gnucash desktop application (https://github.com/Gnucash/gnucash). Developed independently of GnuCash.
Apache License 2.0
84 stars 16 forks source link

Line chart crash #152

Open pnemonic78 opened 3 months ago

pnemonic78 commented 3 months ago

Steps to reproduce the behaviour

  1. Reports screen
  2. Line Chart
  3. select "6 months"
  4. rotate device

Expected behaviour

Not crash

Actual behaviour

Crashes

Software specifications

                 java.lang.RuntimeException: An error occurred while executing doInBackground()
                    at android.os.AsyncTask$4.done(AsyncTask.java:415)
                    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
                    at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:269)
                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                    at java.lang.Thread.run(Thread.java:1012)
                 Caused by: java.lang.IllegalArgumentException: One or more of the DataSet Entry arrays are longer than the x-values array of this ChartData object.
                    at com.github.mikephil.charting.data.ChartData.checkLegal(ChartData.java:182)
                    at com.github.mikephil.charting.data.ChartData.init(ChartData.java:138)
                    at com.github.mikephil.charting.data.ChartData.<init>(ChartData.java:104)
                    at com.github.mikephil.charting.data.BarLineScatterCandleBubbleData.<init>(BarLineScatterCandleBubbleData.java:29)
                    at com.github.mikephil.charting.data.LineData.<init>(LineData.java:29)
                    at org.gnucash.android.ui.report.linechart.CashFlowLineChartFragment.getData(CashFlowLineChartFragment.java:179)
                    at org.gnucash.android.ui.report.linechart.CashFlowLineChartFragment.generateReport(CashFlowLineChartFragment.java:314)
                    at org.gnucash.android.ui.report.BaseReportFragment$1.doInBackground(BaseReportFragment.java:297)
                    at org.gnucash.android.ui.report.BaseReportFragment$1.doInBackground(BaseReportFragment.java:288)
                    at android.os.AsyncTask$3.call(AsyncTask.java:394)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) 
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
                    at java.lang.Thread.run(Thread.java:1012)