Access the XRef data correctly in the "GetStats" handler in src/core/worker.js

Even though the code obviously works as-is, given that we have unit-tests for it, it still feels incorrect to just *assume* that the `XRef`-instance has all of its properties immediately available. Especially when (almost) all of the other handlers, in `src/core/worker.js`, protect their data accesses with appropriate `pdfManager.ensure` calls.
This commit is contained in:
Jonas Jenwald 2020-08-25 11:25:08 +02:00
parent 34cec29288
commit 2e6e2c3b41

View File

@ -507,7 +507,7 @@ class WorkerMessageHandler {
});
handler.on("GetStats", function wphSetupGetStats(data) {
return pdfManager.pdfDocument.xref.stats;
return pdfManager.ensureXRef("stats");
});
handler.on("GetAnnotations", function ({ pageIndex, intent }) {