Skip to content

Commit 282e817

Browse files
masarusanjpOlivier Poitrey
authored and
Olivier Poitrey
committed
Use an empty string to if str was NULL.
1 parent b3895a5 commit 282e817

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SDWebImage/SDImageCache.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ - (NSString *)defaultCachePathForKey:(NSString *)key
112112
- (NSString *)cachedFileNameForKey:(NSString *)key
113113
{
114114
const char *str = [key UTF8String];
115+
if (str == NULL)
116+
{
117+
str = "";
118+
}
115119
unsigned char r[CC_MD5_DIGEST_LENGTH];
116120
CC_MD5(str, (CC_LONG)strlen(str), r);
117121
NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",

0 commit comments

Comments
 (0)