diff --git a/Source/Charts/Charts/ChartViewBase.swift b/Source/Charts/Charts/ChartViewBase.swift index 8074bc2bec..039cf7acb3 100755 --- a/Source/Charts/Charts/ChartViewBase.swift +++ b/Source/Charts/Charts/ChartViewBase.swift @@ -559,14 +559,14 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate if callDelegate, let delegate = delegate { - if h == nil + if let h = h { - delegate.chartValueNothingSelected?(self) + // notify the listener + delegate.chartValueSelected?(self, entry: entry!, highlight: h) } else { - // notify the listener - delegate.chartValueSelected?(self, entry: entry!, highlight: h!) + delegate.chartValueNothingSelected?(self) } }