Ensure that PDFScriptingManager.setDocument
handles failure when initializing the scripting-factory
This way, we'll immediately clean-up in exactly the same way as the other failure code-paths in the `PDFScriptingManager.setDocument` method.
This commit is contained in:
parent
6dc5dd194f
commit
5db7a3cc88
@ -96,7 +96,14 @@ class PDFScriptingManager {
|
||||
if (pdfDocument !== this._pdfDocument) {
|
||||
return; // The document was closed while the data resolved.
|
||||
}
|
||||
this._scripting = this._createScripting();
|
||||
try {
|
||||
this._scripting = this._createScripting();
|
||||
} catch (error) {
|
||||
console.error(`PDFScriptingManager.setDocument: "${error?.message}".`);
|
||||
|
||||
await this._destroyScripting();
|
||||
return;
|
||||
}
|
||||
|
||||
this._internalEvents.set("updatefromsandbox", event => {
|
||||
if (event?.source !== window) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user