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); + } } }