Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit df10f8f

Browse files
author
Scott Goodson
committed
Check array size before accessing section - rare crash for improper data source use, de-escalated to messaging nil.
1 parent 9afb77f commit df10f8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AsyncDisplayKit/Details/ASDataController.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,8 @@ - (NSUInteger)numberOfSections
900900
- (NSUInteger)numberOfRowsInSection:(NSUInteger)section
901901
{
902902
ASDisplayNodeAssertMainThread();
903-
return [[self completedNodes][section] count];
903+
NSArray *completedNodes = [self completedNodes];
904+
return (section < completedNodes.count) ? [completedNodes[section] count] : 0;
904905
}
905906

906907
- (ASCellNode *)nodeAtIndexPath:(NSIndexPath *)indexPath

0 commit comments

Comments
 (0)