diff --git a/SDWebImage/UIView+WebCacheOperation.m b/SDWebImage/UIView+WebCacheOperation.m index d83c8e0c..5be2b03e 100644 --- a/SDWebImage/UIView+WebCacheOperation.m +++ b/SDWebImage/UIView+WebCacheOperation.m @@ -31,9 +31,11 @@ typedef NSMapTable> SDOperationsDictionary; - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key { id operation; - SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; - @synchronized (self) { - operation = [operationDictionary objectForKey:key]; + if (key) { + SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; + @synchronized (self) { + operation = [operationDictionary objectForKey:key]; + } } return operation; }