Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7459)

Unified Diff: chrome/browser/ui/cocoa/tab_contents/favicon_util.mm

Issue 6904030: Merge 83056 - Protect against image conversion failure in mac::FaviconForTabContents(). (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tab_contents/favicon_util.mm
===================================================================
--- chrome/browser/ui/cocoa/tab_contents/favicon_util.mm (revision 83060)
+++ chrome/browser/ui/cocoa/tab_contents/favicon_util.mm (working copy)
@@ -19,8 +19,14 @@
// favicon.
if (contents && contents->FaviconIsValid()) {
CGColorSpaceRef color_space = base::mac::GetSystemColorSpace();
- return gfx::SkBitmapToNSImageWithColorSpace(contents->GetFavicon(),
- color_space);
+ NSImage* image =
+ gfx::SkBitmapToNSImageWithColorSpace(contents->GetFavicon(),
+ color_space);
+ // The |image| could be nil if the bitmap is null. In that case, fallback
+ // to the default image.
+ if (image) {
+ return image;
+ }
}
return app::mac::GetCachedImageWithName(@"nav.pdf");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698