Skip to content

Commit 173199b

Browse files
committed
Only fail a StorageTask once
1 parent 2be2fb3 commit 173199b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

FirebaseStorage/Sources/FIRStorageReference.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,15 @@ - (FIRStorageDownloadTask *)dataWithMaxSize:(int64_t)size
266266
completion(task.downloadData, nil);
267267
});
268268
}];
269+
270+
__block BOOL failed = NO;
269271
[task observeStatus:FIRStorageTaskStatusFailure
270272
handler:^(FIRStorageTaskSnapshot *_Nonnull snapshot) {
271273
dispatch_async(callbackQueue, ^{
272-
completion(nil, snapshot.error);
274+
if (!failed) {
275+
failed = YES;
276+
completion(nil, snapshot.error);
277+
}
273278
});
274279
}];
275280
[task

0 commit comments

Comments
 (0)