aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Core
diff options
context:
space:
mode:
authorGravatar Morgan Chen <morganchen12@gmail.com>2018-02-02 11:22:50 -0800
committerGravatar Morgan Chen <morganchen12@gmail.com>2018-02-02 11:31:32 -0800
commit7422f6218291c66f850c81a1c9ec68516c936e87 (patch)
tree1127ddb0d1ac3795bd817331f0287b8baac6cfd2 /Firestore/Source/Core
parent13f572ea2c57e2cd4c9c2c7c1a7c3b7f338f9fdc (diff)
fix null block execution crash
Diffstat (limited to 'Firestore/Source/Core')
-rw-r--r--Firestore/Source/Core/FSTFirestoreClient.mm8
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) {