Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

Commit 0e6e579

Browse files
committed
Merge pull request #91 from HamzaGhazouani/master
Fix bug for incomplete image downloads in low connection conditions
2 parents ea0d749 + e0bf193 commit 0e6e579

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Pod/Source/Core/Private/DFImageManagerLoader.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,15 @@ - (void)_loadOperation:(nonnull _DFImageLoadOperation *)operation didDecodeParti
255255
}
256256

257257
- (void)_loadOperation:(nonnull _DFImageLoadOperation *)operation didCompleteWithData:(nullable NSData *)data info:(nullable NSDictionary *)info error:(nullable NSError *)error {
258-
if (data.length) {
258+
if (error || !data.length) {
259+
[self _loadOperation:operation didCompleteWithImage:nil info:info error:error];
260+
}
261+
else {
259262
typeof(self) __weak weakSelf = self;
260263
[_decodingQueue addOperationWithBlock:^{
261264
UIImage *image = [weakSelf.conf.decoder imageWithData:data partial:NO];
262265
[weakSelf _loadOperation:operation didCompleteWithImage:image info:info error:error];
263266
}];
264-
} else {
265-
[self _loadOperation:operation didCompleteWithImage:nil info:info error:error];
266267
}
267268
}
268269

0 commit comments

Comments
 (0)