aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Morgan Chen <morganchen12@gmail.com>2018-02-02 11:43:14 -0800
committerGravatar GitHub <noreply@github.com>2018-02-02 11:43:14 -0800
commit070c0ea92fa8bf37bc9e5479aa2e769f796d5de4 (patch)
tree1127ddb0d1ac3795bd817331f0287b8baac6cfd2
parent13f572ea2c57e2cd4c9c2c7c1a7c3b7f338f9fdc (diff)
parent7422f6218291c66f850c81a1c9ec68516c936e87 (diff)
Merge pull request #746 from morganchen12/unguarded-block
fix null block execution crash
-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) {