Removed creation of NSError when a nil URL is downloaded.
This commit is contained in:
parent
b59b42e6b5
commit
599636fa58
|
|
@ -144,13 +144,12 @@ static NSString *const kCompletedCallbackKey = @"completed";
|
|||
|
||||
- (void)addProgressCallback:(void (^)(NSUInteger, long long))progressBlock andCompletedBlock:(void (^)(UIImage *, NSData *data, NSError *, BOOL))completedBlock forURL:(NSURL *)url createCallback:(void (^)())createCallback
|
||||
{
|
||||
// The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data and an error.
|
||||
// The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data.
|
||||
if(url == nil)
|
||||
{
|
||||
if (completedBlock != nil)
|
||||
{
|
||||
NSError *error = [NSError errorWithDomain:@"SDWebImageErrorDomain" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Could not load an image because URL was nil."}];
|
||||
completedBlock(nil, nil, error, NO);
|
||||
completedBlock(nil, nil, nil, NO);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue