diff options
-rw-r--r-- | Firestore/Source/Core/FSTFirestoreClient.mm | 8 |
1 files 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) { |