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

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

Issue 1581083004: Fix NULL crash in PrintViewManager::PrintPreviewDone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/printing/print_preview_dialog_controller.cc
diff --git a/chrome/browser/printing/print_preview_dialog_controller.cc b/chrome/browser/printing/print_preview_dialog_controller.cc
index bdd814fa8eb686554acecfe5a679370f73c7254f..7179c34916cbcfa03c5e5927100dab0a43a7c7ff 100644
--- a/chrome/browser/printing/print_preview_dialog_controller.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller.cc
@@ -166,8 +166,12 @@ void PrintPreviewDialogController::PrintPreview(WebContents* initiator) {
PrintPreviewDialogController* dialog_controller = GetInstance();
if (!dialog_controller)
return;
- if (!dialog_controller->GetOrCreatePreviewDialog(initiator))
- PrintViewManager::FromWebContents(initiator)->PrintPreviewDone();
+ if (!dialog_controller->GetOrCreatePreviewDialog(initiator)) {
+ PrintViewManager* print_view_manager =
+ PrintViewManager::FromWebContents(initiator);
+ if (print_view_manager)
+ print_view_manager->PrintPreviewDone();
+ }
}
WebContents* PrintPreviewDialogController::GetOrCreatePreviewDialog(
« 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