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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1645073004: PDF: Fix a crash from r372196 with the print preview PDFEngine client. (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 | pdf/preview_mode_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 6295ce4632950308589e4d247dbf2b10b7e30f01..6f8f4b3ce9ee43b78cfe5b55697018f220bb2945 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -608,7 +608,10 @@ PDFiumEngine::PDFiumEngine(PDFEngine::Client* client)
IFSDK_PAUSE::NeedToPauseNow = Pause_NeedToPauseNow;
#if defined(OS_LINUX)
- g_last_instance_id = client_->GetPluginInstance()->pp_instance();
+ // PreviewModeClient does not know its pp::Instance.
+ pp::Instance* instance = client_->GetPluginInstance();
+ if (instance)
+ g_last_instance_id = instance->pp_instance();
#endif
}
« no previous file with comments | « no previous file | pdf/preview_mode_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698