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:
Jonas Jenwald 2018-11-05 11:10:31 +01:00
parent 8afb550218
commit 06609b5337

View File

@ -111,6 +111,9 @@ class PDFFindController {
}
executeCommand(cmd, state) {
if (!state) {
return;
}
const pdfDocument = this._pdfDocument;
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {