Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on ASTableView willDisplayCell: due to nil element #709

Open
cesteban opened this issue Dec 11, 2017 · 0 comments
Open

Crash on ASTableView willDisplayCell: due to nil element #709

cesteban opened this issue Dec 11, 2017 · 0 comments

Comments

@cesteban
Copy link
Contributor

Since we updated to Texture 2.5, we are receiving a number of crashes on [ASTableView tableView:willDisplayCell:forRowAtIndexPath:], due to nil ASCollectionElement's:

0   CoreFoundation                       0x0000000188c8efd8 __exceptionPreprocess + 124
1   libobjc.A.dylib                      0x00000001876f0538 objc_exception_throw + 52
2   CoreFoundation                       0x0000000188c8ef20 +[NSException raise:format:] + 112
3   Foundation                           0x0000000189687674 -[NSCountedSet addObject:] + 88
4   AsyncDisplayKit                      0x0000000100cac02c -[ASTableView tableView:willDisplayCell:forRowAtIndexPath:] (ASTableView.mm:986)
5   UIKit                                0x000000018f1031b4 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 844
6   UIKit                                0x000000018f10332c -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 76
7   UIKit                                0x000000018f0f0a30 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2148
8   UIKit                                0x000000018f10831c -[UITableView _performWithCachedTraitCollection:] + 116
9   UIKit                                0x000000018eea092c -[UITableView layoutSubviews] + 172
10  AsyncDisplayKit                      0x0000000100caaf84 -[ASTableView layoutSubviews] (ASTableView.mm:778)
11  UIKit                                0x000000018edbb158 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
12  QuartzCore                           0x000000018bfab274 -[CALayer layoutSublayers] + 144
13  AsyncDisplayKit                      0x0000000100c1a8a0 -[_ASDisplayLayer layoutSublayers] (_ASDisplayLayer.mm:103)
14  QuartzCore                           0x000000018bf9fde8 CA::Layer::layout_if_needed(CA::Transaction*) + 288
15  QuartzCore                           0x000000018bf9fca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
16  QuartzCore                           0x000000018bf1b360 CA::Context::commit_transaction(CA::Transaction*) + 248
17  QuartzCore                           0x000000018bf423c0 CA::Transaction::commit() + 500
18  QuartzCore                           0x000000018bf42e8c CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 116
19  CoreFoundation                       0x0000000188c3c9a0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
20  CoreFoundation                       0x0000000188c3a628 __CFRunLoopDoObservers + 368
21  CoreFoundation                       0x0000000188c3aa74 __CFRunLoopRun + 952
22  CoreFoundation                       0x0000000188b6ad94 CFRunLoopRunSpecific + 420
23  GraphicsServices                     0x000000018a5d4074 GSEventRunModal + 96
24  UIKit                                0x000000018ee23130 UIApplicationMain + 204
25  Tuenti                               0x0000000100321564 main (AppDelegate.swift:18)
26  libdyld.dylib                        0x0000000187b7959c start + 0

After a quick search I found #421, where ASCollectionView is protected against nil elements. I'm lacking some context here, but I assume the same guard should be implemented in ASTableView as well. I prepared a PR with this change.

@appleguy @Adlai-Holler @nguyenhuy please let me know if I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant