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,9 +31,11 @@ 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;
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; if (key) {
@synchronized (self) { SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
operation = [operationDictionary objectForKey:key]; @synchronized (self) {
operation = [operationDictionary objectForKey:key];
}
} }
return operation; return operation;
} }