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

Commit

Permalink
Check array size before accessing section - rare crash for improper d…
Browse files Browse the repository at this point in the history
…ata source use, de-escalated to messaging nil.
  • Loading branch information
Scott Goodson committed Jan 14, 2016
1 parent 9afb77f commit df10f8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AsyncDisplayKit/Details/ASDataController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,8 @@ - (NSUInteger)numberOfSections
- (NSUInteger)numberOfRowsInSection:(NSUInteger)section
{
ASDisplayNodeAssertMainThread();
return [[self completedNodes][section] count];
NSArray *completedNodes = [self completedNodes];
return (section < completedNodes.count) ? [completedNodes[section] count] : 0;
}

- (ASCellNode *)nodeAtIndexPath:(NSIndexPath *)indexPath
Expand Down

0 comments on commit df10f8f

Please sign in to comment.