diff --git a/Source/Charts/Charts/BarLineChartViewBase.swift b/Source/Charts/Charts/BarLineChartViewBase.swift index 1ea179cf01..f272e3367d 100644 --- a/Source/Charts/Charts/BarLineChartViewBase.swift +++ b/Source/Charts/Charts/BarLineChartViewBase.swift @@ -927,7 +927,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD gestureRecognizer == _panGestureRecognizer { var scrollView = self.superview - while !(scrollView is NSUIScrollView) + while scrollView != nil && !(scrollView is NSUIScrollView) { scrollView = scrollView?.superview }