Skip to content

Commit 070c0ea

Browse files
authored
Merge pull request firebase#746 from morganchen12/unguarded-block
fix null block execution crash
2 parents 13f572e + 7422f62 commit 070c0ea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Firestore/Source/Core/FSTFirestoreClient.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,11 @@ - (void)writeMutations:(NSArray<FSTMutation *> *)mutations
253253
completion:(nullable FSTVoidErrorBlock)completion {
254254
[self.workerDispatchQueue dispatchAsync:^{
255255
if (mutations.count == 0) {
256-
[self.userDispatchQueue dispatchAsync:^{
257-
completion(nil);
258-
}];
256+
if (completion) {
257+
[self.userDispatchQueue dispatchAsync:^{
258+
completion(nil);
259+
}];
260+
}
259261
} else {
260262
[self.syncEngine writeMutations:mutations
261263
completion:^(NSError *error) {

0 commit comments

Comments
 (0)