Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 131dd25

Browse files
flovouinappleguy
authored andcommitted
[ASNetworkImageNode] Check that data is not nil before loading the animated image. (#1849)
1 parent dc12042 commit 131dd25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

AsyncDisplayKit/ASNetworkImageNode.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,12 @@ - (void)_lazilyLoadImageIfNecessary
479479
id<ASAnimatedImageProtocol> animatedImage = nil;
480480
if (_downloaderFlags.downloaderImplementsAnimatedImage) {
481481
NSData *data = [NSData dataWithContentsOfURL:_URL];
482-
animatedImage = [_downloader animatedImageWithData:data];
482+
if (data != nil) {
483+
animatedImage = [_downloader animatedImageWithData:data];
483484

484-
if ([animatedImage respondsToSelector:@selector(isDataSupported:)] && [animatedImage isDataSupported:data] == NO) {
485-
animatedImage = nil;
485+
if ([animatedImage respondsToSelector:@selector(isDataSupported:)] && [animatedImage isDataSupported:data] == NO) {
486+
animatedImage = nil;
487+
}
486488
}
487489
}
488490

0 commit comments

Comments
 (0)