From e4104942ee13e2ddc0a98fad79636d9061fc5e6e Mon Sep 17 00:00:00 2001 From: Bogdan Poplauschi Date: Wed, 18 Jun 2014 15:28:13 +0300 Subject: [PATCH] Return nil from SDScaledImageForKey if the input image is nil. Replaces #750. Fixes #365 --- SDWebImage/SDWebImageCompat.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SDWebImage/SDWebImageCompat.m b/SDWebImage/SDWebImageCompat.m index 7f911535..8c7d345a 100644 --- a/SDWebImage/SDWebImageCompat.m +++ b/SDWebImage/SDWebImageCompat.m @@ -13,6 +13,10 @@ #endif inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { + if (!image) { + return nil; + } + if ([image.images count] > 0) { NSMutableArray *scaledImages = [NSMutableArray array];