Skip to content

Commit

Permalink
Merge pull request jwilling#148 from jwilling/jonathan/fix-list-crash
Browse files Browse the repository at this point in the history
Resolve list layout crash
  • Loading branch information
jwilling committed Aug 28, 2015
2 parents b1778be + 2b39b26 commit c3041b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JNWCollectionView/JNWCollectionViewListLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ - (NSArray *)indexPathsForItemsInRect:(CGRect)rect {
NSMutableArray *indexPaths = [NSMutableArray array];

for (JNWCollectionViewListLayoutSection *section in self.sections) {
if (CGRectIntersectsRect(section.frame, rect)) {
if (section.numberOfRows > 0 && CGRectIntersectsRect(section.frame, rect)) {

// Since this is a linear set of data, we run a binary search for optimization
// purposes, finding the rects of the upper and lower bound.
Expand Down

0 comments on commit c3041b9

Please sign in to comment.