Skip to content

Commit

Permalink
Fixed possible out-of-bounds exception when no ranges are present
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Nov 2, 2015
1 parent 530cbab commit 31dd1a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Charts/Classes/Highlight/BarChartHighlighter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ internal class BarChartHighlighter: ChartHighlighter
}
}

let length = ranges!.count - 1
let length = max(ranges!.count - 1, 0)

return (value > ranges![length].to) ? length : 0
}
Expand Down

0 comments on commit 31dd1a5

Please sign in to comment.