Skip to content

Commit

Permalink
Merge pull request #359 from Ewg777/patch-1
Browse files Browse the repository at this point in the history
Fixes a null pointer crash
  • Loading branch information
danielgindi committed Sep 16, 2015
2 parents b647053 + a2923a0 commit fc0d31d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ public class BarLineChartViewBase: ChartViewBase, UIGestureRecognizerDelegate
{
var pt = CGPoint(x: viewPortHandler.contentRight, y: viewPortHandler.contentBottom)
getTransformer(.Left).pixelToValue(&pt)
return (Int(pt.x) >= _data.xValCount) ? _data.xValCount - 1 : Int(pt.x)
return (_data != nil && Int(pt.x) >= _data.xValCount) ? _data.xValCount - 1 : Int(pt.x)
}

/// returns the current x-scale factor
Expand Down

0 comments on commit fc0d31d

Please sign in to comment.