Skip to content

Commit dd3bd71

Browse files
committed
Fix #1168
1 parent f71f85f commit dd3bd71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MPChartLib/src/com/github/mikephil/charting/highlight/BarHighlighter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected int getClosestStackIndex(Range[] ranges, float value) {
131131
stackIndex++;
132132
}
133133

134-
int length = ranges.length - 1;
134+
int length = Math.max(ranges.length - 1, 0);
135135

136136
return (value > ranges[length].to) ? length : 0;
137137
//

0 commit comments

Comments
 (0)