mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
[AltStore] Fixes crash after deleting app from home screen
If the user never opened the My Apps tab, but then deleted an AltStore app from the home screen and then returned to AltStore, the app would crash when trying to update MyAppsViewController.collectionView.
This commit is contained in:
@@ -688,6 +688,13 @@ extension MyAppsViewController: NSFetchedResultsControllerDelegate
|
||||
{
|
||||
func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>)
|
||||
{
|
||||
// Responding to NSFetchedResultsController updates before the collection view has
|
||||
// been shown may throw exceptions because the collection view cannot accurately
|
||||
// count the number of items before the update. However, if we manually call
|
||||
// performBatchUpdates _before_ responding to updates, the collection view can get
|
||||
// an accurate pre-update item count.
|
||||
self.collectionView.performBatchUpdates(nil, completion: nil)
|
||||
|
||||
self.updatesDataSource.controllerWillChangeContent(controller)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user