Merge commit '4355f4d2eef9472642a8a8029aeef1c7fdad034f' into debug-drawrect

This commit is contained in:
Peter
2016-12-12 01:10:39 +03:00
22 changed files with 346 additions and 290 deletions

View File

@@ -644,7 +644,9 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
return nil;
}
if (indexPath.item >= [self numberOfItemsInSection:section]) {
NSInteger item = indexPath.item;
// item == NSNotFound means e.g. "scroll to this section" and is acceptable
if (item != NSNotFound && item >= [self numberOfItemsInSection:section]) {
ASDisplayNodeFailAssert(@"Collection view index path has invalid item %lu in section %lu, item count = %lu", (unsigned long)indexPath.item, (unsigned long)section, (unsigned long)[self numberOfItemsInSection:section]);
return nil;
}