Authored by liushuaikobe

If the sd_imageURL of the UIImageView or UIButton is nil, won't create a NSError Instance

@@ -57,8 +57,8 @@ static char imageURLStorageKey; @@ -57,8 +57,8 @@ static char imageURLStorageKey;
57 [self.imageURLStorage removeObjectForKey:@(state)]; 57 [self.imageURLStorage removeObjectForKey:@(state)];
58 58
59 dispatch_main_async_safe(^{ 59 dispatch_main_async_safe(^{
60 - NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];  
61 if (completedBlock) { 60 if (completedBlock) {
  61 + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
62 completedBlock(nil, error, SDImageCacheTypeNone, url); 62 completedBlock(nil, error, SDImageCacheTypeNone, url);
63 } 63 }
64 }); 64 });
@@ -87,8 +87,8 @@ static char TAG_ACTIVITY_SHOW; @@ -87,8 +87,8 @@ static char TAG_ACTIVITY_SHOW;
87 } else { 87 } else {
88 dispatch_main_async_safe(^{ 88 dispatch_main_async_safe(^{
89 [self removeActivityIndicator]; 89 [self removeActivityIndicator];
90 - NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];  
91 if (completedBlock) { 90 if (completedBlock) {
  91 + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
92 completedBlock(nil, error, SDImageCacheTypeNone, url); 92 completedBlock(nil, error, SDImageCacheTypeNone, url);
93 } 93 }
94 }); 94 });