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

Unified Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 7038041: Print Preview: Check the result from GetPrintPreviewData() and return on failure. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/webui/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_handler.cc (revision 86128)
+++ chrome/browser/ui/webui/print_preview_handler.cc (working copy)
@@ -448,8 +448,10 @@
PrintPreviewUIHTMLSource::PrintPreviewData data;
PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_);
print_preview_ui->html_source()->GetPrintPreviewData(&data);
- DCHECK(data.first);
- DCHECK_GT(data.second, 0U);
+ if (!data.first || !data.second) {
+ NOTREACHED();
+ return;
+ }
printing::PreviewMetafile* metafile = new printing::PreviewMetafile;
metafile->InitFromData(data.first->memory(), data.second);
« 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