Merge pull request #1676 from jimmaye/background-crash-io10

#1619: Adds NSError as input to resourceValuesForKeys:error: method
This commit is contained in:
Bogdan Poplauschi 2016-09-30 21:26:02 +03:00
commit fc3a4d8170
1 changed files with 4 additions and 3 deletions

View File

@ -504,10 +504,11 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
// 2. Storing file attributes for the size-based cleanup pass.
NSMutableArray<NSURL *> *urlsToDelete = [[NSMutableArray alloc] init];
for (NSURL *fileURL in fileEnumerator) {
NSDictionary<NSString *, id> *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:NULL];
NSError *error;
NSDictionary<NSString *, id> *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error];
// Skip directories.
if ([resourceValues[NSURLIsDirectoryKey] boolValue]) {
// Skip directories and errors.
if (error || [resourceValues[NSURLIsDirectoryKey] boolValue]) {
continue;
}