Skip to content

Commit

Permalink
Merge pull request #2500 from liuxuan30/2099
Browse files Browse the repository at this point in the history
fix #2099, avoid crash when some chart only allow 1 data set
  • Loading branch information
liuxuan30 committed Jun 5, 2017
2 parents 1254a87 + 4a65b41 commit 6698fd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Charts/Renderers/LegendRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class LegendRenderer: Renderer
// loop for building up the colors and labels used in the legend
for i in 0..<data.dataSetCount
{
let dataSet = data.getDataSetByIndex(i)!
guard let dataSet = data.getDataSetByIndex(i) else { continue }

var clrs: [NSUIColor] = dataSet.colors
let entryCount = dataSet.entryCount
Expand Down

0 comments on commit 6698fd3

Please sign in to comment.