1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Merge pull request #14600 from Snuffleupagus/getPageIndex-more-validation

[api-minor] Add validation for the  `PDFDocumentProxy.getPageIndex` method
This commit is contained in:
Tim van der Meij 2022-02-26 15:30:00 +01:00 committed by GitHub
commit cf7ce0aa7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 46 deletions

View file

@ -454,8 +454,8 @@ class WorkerMessageHandler {
});
});
handler.on("GetPageIndex", function wphSetupGetPageIndex({ ref }) {
const pageRef = Ref.get(ref.num, ref.gen);
handler.on("GetPageIndex", function wphSetupGetPageIndex(data) {
const pageRef = Ref.get(data.num, data.gen);
return pdfManager.ensureCatalog("getPageIndex", [pageRef]);
});