From 7bb6e5ba8dcd0babf8b030a41977018a3511629a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 1 Aug 2019 09:23:10 -0400 Subject: [PATCH] check before use --- MVMCoreUI/Molecules/MVMCoreUIPageControl.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Molecules/MVMCoreUIPageControl.m b/MVMCoreUI/Molecules/MVMCoreUIPageControl.m index 16783ca9..6648b513 100644 --- a/MVMCoreUI/Molecules/MVMCoreUIPageControl.m +++ b/MVMCoreUI/Molecules/MVMCoreUIPageControl.m @@ -297,7 +297,9 @@ static CGFloat const IndicatorRectangleHeight = 4; if (selectedIndex != NSNotFound) { self.currentPage = selectedIndex; [self sendActionsForControlEvents:UIControlEventValueChanged]; - self.pagingTouchBlock(self); + if (self.pagingTouchBlock) { + self.pagingTouchBlock(self); + } } } } @@ -351,7 +353,9 @@ static CGFloat const IndicatorRectangleHeight = 4; if ((index < self.numberOfPages && index >= 0) || self.alwaysSendingControlEvent) { [self setCurrentPage:index animated:NO]; [self sendActionsForControlEvents:UIControlEventValueChanged]; - self.pagingTouchBlock(self); + if (self.pagingTouchBlock) { + self.pagingTouchBlock(self); + } } }