Authored by Bogdan Poplauschi

Fix #1619 iOS10 Crash issue

@@ -508,7 +508,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -508,7 +508,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
508 NSDictionary<NSString *, id> *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error]; 508 NSDictionary<NSString *, id> *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error];
509 509
510 // Skip directories and errors. 510 // Skip directories and errors.
511 - if (error || [resourceValues[NSURLIsDirectoryKey] boolValue]) { 511 + if (error || !resourceValues || [resourceValues[NSURLIsDirectoryKey] boolValue]) {
512 continue; 512 continue;
513 } 513 }
514 514