summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/cocoa/nsimage_cache.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/nsimage_cache.mm b/chrome/browser/cocoa/nsimage_cache.mm
index 48e34ed..05957ea6 100644
--- a/chrome/browser/cocoa/nsimage_cache.mm
+++ b/chrome/browser/cocoa/nsimage_cache.mm
@@ -31,7 +31,8 @@ NSImage *ImageNamed(NSString *name) {
if (path) {
@try {
result = [[[NSImage alloc] initWithContentsOfFile:path] autorelease];
- [image_cache setObject:result forKey:name];
+ if (result)
+ [image_cache setObject:result forKey:name];
}
@catch (id err) {
DLOG(ERROR) << "Failed to load the image for name '"
@@ -42,7 +43,7 @@ NSImage *ImageNamed(NSString *name) {
}
}
- // TODO: if we put ever limit the cache size, this should retain & autorelease
+ // TODO: if we ever limit the cache size, this should retain & autorelease
// the image.
return result;
}