From 7422f6218291c66f850c81a1c9ec68516c936e87 Mon Sep 17 00:00:00 2001 From: Morgan Chen Date: Fri, 2 Feb 2018 11:22:50 -0800 Subject: fix null block execution crash --- Firestore/Source/Core/FSTFirestoreClient.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Firestore/Source/Core/FSTFirestoreClient.mm b/Firestore/Source/Core/FSTFirestoreClient.mm index fff644d..5986b5b 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.mm +++ b/Firestore/Source/Core/FSTFirestoreClient.mm @@ -253,9 +253,11 @@ NS_ASSUME_NONNULL_BEGIN completion:(nullable FSTVoidErrorBlock)completion { [self.workerDispatchQueue dispatchAsync:^{ if (mutations.count == 0) { - [self.userDispatchQueue dispatchAsync:^{ - completion(nil); - }]; + if (completion) { + [self.userDispatchQueue dispatchAsync:^{ + completion(nil); + }]; + } } else { [self.syncEngine writeMutations:mutations completion:^(NSError *error) { -- cgit v1.2.3