[ASNetworkImageNode] Check that data is not nil before loading the animated image. (#1849)

This commit is contained in:
Flo
2016-07-10 06:19:57 +02:00
committed by appleguy
parent dc12042589
commit 131dd25de3

View File

@@ -479,10 +479,12 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};
id<ASAnimatedImageProtocol> animatedImage = nil;
if (_downloaderFlags.downloaderImplementsAnimatedImage) {
NSData *data = [NSData dataWithContentsOfURL:_URL];
animatedImage = [_downloader animatedImageWithData:data];
if (data != nil) {
animatedImage = [_downloader animatedImageWithData:data];
if ([animatedImage respondsToSelector:@selector(isDataSupported:)] && [animatedImage isDataSupported:data] == NO) {
animatedImage = nil;
if ([animatedImage respondsToSelector:@selector(isDataSupported:)] && [animatedImage isDataSupported:data] == NO) {
animatedImage = nil;
}
}
}