Fix nullable key when get image load operation

This commit is contained in:
zhongwuzw 2018-07-17 17:51:23 +08:00
parent 957de6d70f
commit 820f13ec93
1 changed files with 5 additions and 3 deletions

View File

@ -31,10 +31,12 @@ typedef NSMapTable<NSString *, id<SDWebImageOperation>> SDOperationsDictionary;
- (nullable id<SDWebImageOperation>)sd_imageLoadOperationForKey:(nullable NSString *)key { - (nullable id<SDWebImageOperation>)sd_imageLoadOperationForKey:(nullable NSString *)key {
id<SDWebImageOperation> operation; id<SDWebImageOperation> operation;
if (key) {
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
@synchronized (self) { @synchronized (self) {
operation = [operationDictionary objectForKey:key]; operation = [operationDictionary objectForKey:key];
} }
}
return operation; return operation;
} }