Skip to content

Commit

Permalink
Merge pull request #12717 from Snuffleupagus/issue-12714
Browse files Browse the repository at this point in the history
Ensure that the /Annots-entry, on /Page-instances, is actually an Array (issue 12714)
  • Loading branch information
timvandermeij committed Dec 10, 2020
2 parents 954ac3d + 796a0d3 commit 00b4f86
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,8 @@ class Page {
}

get annotations() {
return shadow(
this,
"annotations",
this._getInheritableProperty("Annots") || []
);
const annots = this._getInheritableProperty("Annots");
return shadow(this, "annotations", Array.isArray(annots) ? annots : []);
}

get _parsedAnnotations() {
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue12714.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/5669997/b49fe733-63e0-4972-8b47-3a05c2c8e881.pdf
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,15 @@
"link": true,
"type": "eq"
},
{ "id": "issue12714",
"file": "pdfs/issue12714.pdf",
"md5": "f9ee31c74f9e342e95122b0b3bc84fa0",
"rounds": 1,
"firstPage": 2,
"lastPage": 2,
"link": true,
"type": "eq"
},
{ "id": "issue7872",
"file": "pdfs/issue7872.pdf",
"md5": "81781dfecfcb7e9cd9cc7e60f8b747b7",
Expand Down

0 comments on commit 00b4f86

Please sign in to comment.