Commit e2e175a7 authored by Tom Sepez's avatar Tom Sepez Committed by Commit Bot

OutOfProcessEngine::ScrollToPage(): check for null engine

This callback may be reached as part of a close document action
after the engine has been destroyed. Further inspection of the code
shows that the same might also happen for Print().

Bug: 901640
Change-Id: I8faaeaf72adb37441f9e9c977093273c9e055e91
Reviewed-on: https://chromium-review.googlesource.com/c/1320810Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605829}
parent 5696a541
...@@ -1385,7 +1385,7 @@ void OutOfProcessInstance::ScrollBy(const pp::Point& point) { ...@@ -1385,7 +1385,7 @@ void OutOfProcessInstance::ScrollBy(const pp::Point& point) {
} }
void OutOfProcessInstance::ScrollToPage(int page) { void OutOfProcessInstance::ScrollToPage(int page) {
if (engine_->GetNumberOfPages() == 0) if (!engine_ || engine_->GetNumberOfPages() == 0)
return; return;
pp::VarDictionary message; pp::VarDictionary message;
...@@ -1582,8 +1582,9 @@ void OutOfProcessInstance::Email(const std::string& to, ...@@ -1582,8 +1582,9 @@ void OutOfProcessInstance::Email(const std::string& to,
} }
void OutOfProcessInstance::Print() { void OutOfProcessInstance::Print() {
if (!engine_->HasPermission(PDFEngine::PERMISSION_PRINT_LOW_QUALITY) && if (!engine_ ||
!engine_->HasPermission(PDFEngine::PERMISSION_PRINT_HIGH_QUALITY)) { (!engine_->HasPermission(PDFEngine::PERMISSION_PRINT_LOW_QUALITY) &&
!engine_->HasPermission(PDFEngine::PERMISSION_PRINT_HIGH_QUALITY))) {
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment