Closed herzbube closed 1 year ago
The line indication is clearly wrong, as there is no call to the NSArray
method objectAtIndex:
at line 485. However if we dive deeper into what does happen on line 485 we see that the objectAtIndex:
method is eventually invoked within GoNodeModel.m
, in method nodeAtIndex:
.
The only way how this can happen is if a cell gets reused and still has its old value for the boardPosition
property, while UIKit also decides that it needs to invoke traitCollectionDidChange:
. If the cell reuse occurs e.g. after a new game was started, or after some board positions were discarded, then the boardPosition
property value may easily be invalid now.
The issue cannot be reproduced easily because cell reuse is not under our control.
Received multiple crash reports via Firebase/Crashlytics on day 1 after the release of 1.7.0.
Crash report indicates the following:
BoardPositionCollectionViewCell.m
, line 485traitCollectionDidChange:
NSRangeException
*** -[__NSArrayM objectAtIndex:]: index 28 beyond bounds [0 .. 1]