check before use

This commit is contained in:
Pfeil, Scott Robert 2019-08-01 09:23:10 -04:00
parent 245d7d93d6
commit 7bb6e5ba8d

View File

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