From 599636fa58d64f515fd4316e4f5026a5d4a74cbd Mon Sep 17 00:00:00 2001 From: Reid Main Date: Wed, 16 Jan 2013 22:22:33 -0500 Subject: [PATCH] Removed creation of NSError when a nil URL is downloaded. --- SDWebImage/SDWebImageDownloader.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 5e3d097..ef039b9 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -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; }