diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 21:19:35 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 21:19:35 +0000 |
commit | 1d4efb6bc9f956cdbca55c7a4ba99d1bb76e42f8 (patch) | |
tree | eda01b6a58932465153b1dd453e74cea0a22babe /chrome | |
parent | 3cb4e1c695e282e1d1507b92b3b1cd7433419e7e (diff) | |
download | chromium_src-1d4efb6bc9f956cdbca55c7a4ba99d1bb76e42f8.zip chromium_src-1d4efb6bc9f956cdbca55c7a4ba99d1bb76e42f8.tar.gz chromium_src-1d4efb6bc9f956cdbca55c7a4ba99d1bb76e42f8.tar.bz2 |
If the init returns nil (don't throw) don't try to store that into the dict.
Fix typo.
Review URL: http://codereview.chromium.org/155318
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/nsimage_cache.mm | 5 |
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; } |