Skip to content

Commit

Permalink
fix a crash while dataSetIndex < 0 and tries to highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxuan30 committed Jun 15, 2015
1 parent 266622e commit 24ec97f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Charts/Classes/Charts/PieRadarChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import Foundation
import CoreGraphics
import UIKit.UIGestureRecognizer
import UIKit

/// Base class of PieChartView and RadarChartView.
public class PieRadarChartViewBase: ChartViewBase
Expand Down Expand Up @@ -753,6 +753,11 @@ public class PieRadarChartViewBase: ChartViewBase
dataSetIndex = ChartUtils.closestDataSetIndex(valsAtIndex, value: Double(distance / (self as! RadarChartView).factor), axis: nil);
}

if (dataSetIndex < 0)
{
return;
}

var h = ChartHighlight(xIndex: index, dataSetIndex: dataSetIndex);

if (_lastHighlight !== nil && h == _lastHighlight)
Expand Down

0 comments on commit 24ec97f

Please sign in to comment.