Merge pull request #2389 from zhongwuzw/fix-nullable-5.x

Fix nullable key when get image load operation
This commit is contained in:
DreamPiggy 2018-07-17 22:56:34 +08:00 committed by GitHub
commit 56a8684e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {
id<SDWebImageOperation> operation;
if (key) {
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
@synchronized (self) {
operation = [operationDictionary objectForKey:key];
}
}
return operation;
}