A little coding style fix for block invoke

This commit is contained in:
DreamPiggy 2019-08-02 13:34:42 +08:00
parent 67b29b9d07
commit 95ed9e1576
1 changed files with 3 additions and 1 deletions

View File

@ -130,7 +130,9 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
}
SDWebImageDownloaderCompletedBlock completedBlock = [token valueForKey:kCompletedCallbackKey];
dispatch_main_async_safe(^{
completedBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorCancelled userInfo:nil], YES);
if (completedBlock) {
completedBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorCancelled userInfo:nil], YES);
}
});
}
return shouldCancel;