Merge pull request #1439 from Moral-Piggy/master

Without creating a NSError instance when completedBlock is nil
This commit is contained in:
Bogdan Poplauschi 2016-01-20 17:28:44 +02:00
commit 9ecf488aff
2 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ static char imageURLStorageKey;
[self.imageURLStorage removeObjectForKey:@(state)];
dispatch_main_async_safe(^{
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
if (completedBlock) {
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
completedBlock(nil, error, SDImageCacheTypeNone, url);
}
});

View File

@ -87,8 +87,8 @@ static char TAG_ACTIVITY_SHOW;
} else {
dispatch_main_async_safe(^{
[self removeActivityIndicator];
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
if (completedBlock) {
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
completedBlock(nil, error, SDImageCacheTypeNone, url);
}
});