Skip to content

Commit

Permalink
Fix crash when there's no sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Amin authored and Sophie Amin committed Apr 8, 2024
1 parent dcc4aec commit 07e88a2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class TabTrayAnimationQueueImplementation: TabTrayAnimationQueue {
/// Fix crash related to bug from `collectionView.performBatchUpdates` when the
/// collectionView is not visible the dataSource section/items differs from the actions to be perform
/// which causes the crash
collectionView.numberOfItems(inSection: 0)
if collectionView.numberOfSections != 0 {
collectionView.numberOfItems(inSection: 0)
}
collectionView.performBatchUpdates({
animation()
}, completion: { [weak self] (done) in
Expand Down

0 comments on commit 07e88a2

Please sign in to comment.