fix crash when looped slider with item count zero

This commit is contained in:
王劲鹏
2021-07-08 09:48:24 +08:00
committed by osborn
parent e6595d5c51
commit 98f2d29cee
2 changed files with 4 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ - (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValu
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (self.loop) {
if (self.loop && self.itemCount > 0) {
return self.itemCount + 2;
} else {
return self.itemCount;