Merge pull request #1439 from Moral-Piggy/master
Without creating a NSError instance when completedBlock is nil
This commit is contained in:
commit
9ecf488aff
|
@ -57,8 +57,8 @@ static char imageURLStorageKey;
|
||||||
[self.imageURLStorage removeObjectForKey:@(state)];
|
[self.imageURLStorage removeObjectForKey:@(state)];
|
||||||
|
|
||||||
dispatch_main_async_safe(^{
|
dispatch_main_async_safe(^{
|
||||||
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
|
|
||||||
if (completedBlock) {
|
if (completedBlock) {
|
||||||
|
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
|
||||||
completedBlock(nil, error, SDImageCacheTypeNone, url);
|
completedBlock(nil, error, SDImageCacheTypeNone, url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -87,8 +87,8 @@ static char TAG_ACTIVITY_SHOW;
|
||||||
} else {
|
} else {
|
||||||
dispatch_main_async_safe(^{
|
dispatch_main_async_safe(^{
|
||||||
[self removeActivityIndicator];
|
[self removeActivityIndicator];
|
||||||
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
|
|
||||||
if (completedBlock) {
|
if (completedBlock) {
|
||||||
|
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
|
||||||
completedBlock(nil, error, SDImageCacheTypeNone, url);
|
completedBlock(nil, error, SDImageCacheTypeNone, url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue