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

Unified Diff: chrome/browser/printing/print_job_worker.cc

Issue 1338333002: Add checks for android printing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test. It still is kind of flaky (2/30, the print dialog comes up -> timeout), but no crash Created 5 years, 3 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
Index: chrome/browser/printing/print_job_worker.cc
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 97ef340dcb9a891077befbe15d9f10209712ca40..4648e1f594746184437c02166f54e4db0bf39731 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -219,7 +219,8 @@ void PrintJobWorker::GetSettingsWithUI(
static_cast<PrintingContextDelegate*>(printing_context_delegate_.get());
content::WebContents* web_contents =
printing_context_delegate->GetWebContents();
- TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
+ TabAndroid* tab =
+ web_contents ? TabAndroid::FromWebContents(web_contents) : nullptr;
// Regardless of whether the following call fails or not, the javascript
// call will return since startPendingPrint will make it return immediately

Powered by Google App Engine
This is Rietveld 408576698