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
@ -111,6 +111,9 @@ class PDFFindController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
executeCommand(cmd, state) {
|
executeCommand(cmd, state) {
|
||||||
|
if (!state) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const pdfDocument = this._pdfDocument;
|
const pdfDocument = this._pdfDocument;
|
||||||
|
|
||||||
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
|
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user