Fix crash if batch update blocks are nil although method declaration allows nullable (#2599)

This commit is contained in:
Michael Schneider
2016-11-13 17:15:11 -08:00
committed by Adlai Holler
parent ae11fc755e
commit 44aa582ceb
4 changed files with 25 additions and 2 deletions

View File

@@ -521,7 +521,9 @@ ASEnvironmentCollectionTableSetEnvironmentState(_environmentStateLock)
- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion
{
[self.view beginUpdates];
updates();
if (updates) {
updates();
}
[self.view endUpdatesAnimated:animated completion:completion];
}