Fix crash with mpandroidchart 3.0pre (master)

This commit is contained in:
cpfeiffer 2016-10-04 23:39:14 +02:00
parent 478782998e
commit e5d178b315
1 changed files with 2 additions and 2 deletions

View File

@ -735,10 +735,10 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
@Override @Override
public String getFormattedValue(float value, AxisBase axis) { public String getFormattedValue(float value, AxisBase axis) {
if (xLabels == null) { int index = (int) value;
if (xLabels == null || index >= xLabels.size()) {
return String.valueOf(value); return String.valueOf(value);
} }
int index = (int) value;
return xLabels.get(index); return xLabels.get(index);
} }