Skip to content

Commit 5aafe92

Browse files
committed
Merge pull request PhilJay#1140 from danielgindi/draw-circles-crash
Fixed potential crash when line data is empty
2 parents 5f5950b + 25336b8 commit 5aafe92

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

MPChartLib/src/com/github/mikephil/charting/renderer/LineChartRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ protected void drawCircles(Canvas c) {
485485

486486
LineDataSet dataSet = dataSets.get(i);
487487

488-
if (!dataSet.isVisible() || !dataSet.isDrawCirclesEnabled())
488+
if (!dataSet.isVisible() || !dataSet.isDrawCirclesEnabled() ||
489+
dataSet.getEntryCount() == 0)
489490
continue;
490491

491492
mCirclePaintInner.setColor(dataSet.getCircleHoleColor());

0 commit comments

Comments
 (0)