From 4bdbf4bb3d258d55937f380bec0bd48641afda3c Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 18 Jun 2024 22:30:21 +0200 Subject: [PATCH] Avoid to call a function in the js sandbox when it has been destroyed --- src/pdf.sandbox.external.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pdf.sandbox.external.js b/src/pdf.sandbox.external.js index ce77db1c6..365d94a60 100644 --- a/src/pdf.sandbox.external.js +++ b/src/pdf.sandbox.external.js @@ -62,6 +62,9 @@ export class SandboxSupportBase { * @param {Array} args - Arguments of the function. */ callSandboxFunction(name, args) { + if (!this.commFun) { + return; + } try { args = this.exportValueToSandbox(args); this.commFun(name, args);