mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Prevent errors if PDFFindController.executeCommand
is ever called without a state
object
Most of the code in `PDFFindController` assumes that a valid `state` always exits, hence it cannot hurt to add a simple check to avoid errors being thrown.
This commit is contained in:
parent
8afb550218
commit
06609b5337
1 changed files with 3 additions and 0 deletions
|
@ -111,6 +111,9 @@ class PDFFindController {
|
|||
}
|
||||
|
||||
executeCommand(cmd, state) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const pdfDocument = this._pdfDocument;
|
||||
|
||||
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue