Skip to content

Commit

Permalink
Safe guards
Browse files Browse the repository at this point in the history
These will be even more important when moving to Kotlin ranges
  • Loading branch information
danielgindi committed Jan 23, 2020
1 parent d86f39c commit 4192f52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public void calcMinMaxY(float fromX, float toX) {
int indexFrom = getEntryIndex(fromX, Float.NaN, Rounding.DOWN);
int indexTo = getEntryIndex(toX, Float.NaN, Rounding.UP);

if (indexTo < indexFrom) return;

for (int i = indexFrom; i <= indexTo; i++) {

// only recalculate y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void computeLegend(ChartData<?> data) {
for (int i = 0; i < data.getDataSetCount(); i++) {

IDataSet dataSet = data.getDataSetByIndex(i);
if (dataSet == null) continue;

List<Integer> clrs = dataSet.getColors();
int entryCount = dataSet.getEntryCount();
Expand Down

0 comments on commit 4192f52

Please sign in to comment.