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

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