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

Unified Diff: chrome/browser/dom_ui/dom_ui_theme_source.cc

Issue 159146: Sometimes it's possible for a DOMUI to request images that don't exist (theme... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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/dom_ui/dom_ui_theme_source.cc
===================================================================
--- chrome/browser/dom_ui/dom_ui_theme_source.cc (revision 21189)
+++ chrome/browser/dom_ui/dom_ui_theme_source.cc (working copy)
@@ -148,7 +148,11 @@
DCHECK(tp);
SkBitmap* image = tp->GetBitmapNamed(resource_id);
- DCHECK(image);
+ if (!image || image->empty()) {
+ SendResponse(request_id, NULL);
+ return;
+ }
+
std::vector<unsigned char> png_bytes;
PNGEncoder::EncodeBGRASkBitmap(*image, false, &png_bytes);
« 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