Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
[Issue #308] Fixing crash caused by attempting to cache invalid or ni…
Browse files Browse the repository at this point in the history
…l image
  • Loading branch information
mattt committed Apr 19, 2012
1 parent 94d6a6c commit 9adb586
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion AFNetworking/UIImageView+AFNetworking.m
Expand Up @@ -172,7 +172,9 @@ - (UIImage *)cachedImageForRequest:(NSURLRequest *)request {
- (void)cacheImage:(UIImage *)image - (void)cacheImage:(UIImage *)image
forRequest:(NSURLRequest *)request forRequest:(NSURLRequest *)request
{ {
[self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)]; if (image && request) {
[self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)];
}
} }


@end @end
Expand Down

0 comments on commit 9adb586

Please sign in to comment.