From 7940577b123a1a5f76140cb28599a0c997d034f1 Mon Sep 17 00:00:00 2001 From: Bogdan Poplauschi Date: Sat, 1 Oct 2016 12:13:31 +0300 Subject: [PATCH] Fix #1619 iOS10 Crash issue --- SDWebImage/SDImageCache.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 65315a0b..acd5ee6a 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -508,7 +508,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { NSDictionary *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error]; // Skip directories and errors. - if (error || [resourceValues[NSURLIsDirectoryKey] boolValue]) { + if (error || !resourceValues || [resourceValues[NSURLIsDirectoryKey] boolValue]) { continue; }