Skip to content

Commit

Permalink
Merge pull request ChartsOrg#2167 from Bellabeat/fix
Browse files Browse the repository at this point in the history
Fixes index out of range crash.
  • Loading branch information
pmairoldi committed Feb 15, 2017
2 parents 32e0410 + f30d9b3 commit 32e7c36
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ open class ChartDataSet: ChartBaseDataSet
/// if `i` is out of bounds, it may throw an out-of-bounds exception
open override func entryForIndex(_ i: Int) -> ChartDataEntry?
{
guard i >= 0 && i < _values.count else {
return nil
}
return _values[i]
}

Expand Down

0 comments on commit 32e7c36

Please sign in to comment.