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:
parent
34cec29288
commit
2e6e2c3b41
@ -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 }) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user