Add some security around wrongly typed URL argument
This commit is contained in:
parent
5f27d2d20d
commit
40524876e9
|
|
@ -123,6 +123,10 @@ static SDWebImageManager *instance;
|
|||
{
|
||||
url = [NSURL URLWithString:(NSString *)url];
|
||||
}
|
||||
else if (![url isKindOfClass:NSURL.class])
|
||||
{
|
||||
url = nil; // Prevent some common crashes due to common wrong values passed like NSNull.null for instance
|
||||
}
|
||||
|
||||
if (!url || !delegate || (!(options & SDWebImageRetryFailed) && [failedURLs containsObject:url]))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue