Skip to content

Commit ddd03f7

Browse files
author
Olivier Poitrey
committed
Add some sanity check on the URL parameter
1 parent 4284b57 commit ddd03f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SDWebImage/SDWebImageManager.m

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ - (NSString *)cacheKeyForURL:(NSURL *)url
6969
url = [NSURL URLWithString:(NSString *)url];
7070
}
7171

72+
// Prevents app crashing on argument type error like sending NSNull instead of NSURL
73+
if (![url isKindOfClass:NSURL.class])
74+
{
75+
url = nil;
76+
}
77+
7278
__block SDWebImageCombinedOperation *operation = SDWebImageCombinedOperation.new;
7379

7480
if (!url || !completedBlock || (!(options & SDWebImageRetryFailed) && [self.failedURLs containsObject:url]))

0 commit comments

Comments
 (0)