From e5d178b315cb28f982e6a12fc9d12f0608b5b3a6 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Tue, 4 Oct 2016 23:39:14 +0200 Subject: [PATCH] Fix crash with mpandroidchart 3.0pre (master) --- .../gadgetbridge/activities/charts/AbstractChartFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java index f0a1c7b7..c6896ccd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java @@ -735,10 +735,10 @@ public abstract class AbstractChartFragment extends AbstractGBFragment { @Override public String getFormattedValue(float value, AxisBase axis) { - if (xLabels == null) { + int index = (int) value; + if (xLabels == null || index >= xLabels.size()) { return String.valueOf(value); } - int index = (int) value; return xLabels.get(index); }