File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,9 @@ - (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key {
419
419
}
420
420
421
421
- (nullable UIImage *)imageFromDiskCacheForKey : (nullable NSString *)key options : (SDImageCacheOptions)options context : (nullable SDWebImageContext *)context {
422
+ if (!key) {
423
+ return nil ;
424
+ }
422
425
NSData *data = [self diskImageDataForKey: key];
423
426
UIImage *diskImage = [self diskImageForKey: key data: data options: options context: context];
424
427
@@ -507,6 +510,9 @@ - (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *
507
510
}
508
511
509
512
- (nullable UIImage *)diskImageForKey : (nullable NSString *)key {
513
+ if (!key) {
514
+ return nil ;
515
+ }
510
516
NSData *data = [self diskImageDataForKey: key];
511
517
return [self diskImageForKey: key data: data options: 0 context: nil ];
512
518
}
@@ -521,7 +527,7 @@ - (nullable UIImage *)diskImageForKey:(nullable NSString *)key data:(nullable NS
521
527
}
522
528
523
529
- (void )_unarchiveObjectWithImage : (UIImage *)image forKey : (NSString *)key {
524
- if (!image) {
530
+ if (!image || !key ) {
525
531
return ;
526
532
}
527
533
// Check extended data
@@ -721,7 +727,7 @@ - (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withC
721
727
}
722
728
723
729
- (void )removeImageForKey : (nullable NSString *)key fromMemory : (BOOL )fromMemory fromDisk : (BOOL )fromDisk withCompletion : (nullable SDWebImageNoParamsBlock)completion {
724
- if (key == nil ) {
730
+ if (! key) {
725
731
return ;
726
732
}
727
733
You can’t perform that action at this time.
0 commit comments