From 54ef4370a2994dfb41791a13633a4cda86894ee3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 12 Apr 2021 13:48:34 +0200 Subject: [PATCH] Ensure that the data is loaded, in the "GetPageJSActions" message handler Similar to all other data accesses, note e.g. the "GetDocJSActions" handler just above, we need to ensure that a `MissingDataException` isn't propagated to the main-thread if this data is accessed while the PDF document is still loading. --- src/core/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/worker.js b/src/core/worker.js index 4cf69b769..76f47a250 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -487,7 +487,7 @@ class WorkerMessageHandler { handler.on("GetPageJSActions", function ({ pageIndex }) { return pdfManager.getPage(pageIndex).then(function (page) { - return page.jsActions; + return pdfManager.ensure(page, "jsActions"); }); });