diff --git a/src/core/document.js b/src/core/document.js index 4736a2839cfa1..4f6951d40594c 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -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() { diff --git a/test/pdfs/issue12714.pdf.link b/test/pdfs/issue12714.pdf.link new file mode 100644 index 0000000000000..562eb68b60bda --- /dev/null +++ b/test/pdfs/issue12714.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/5669997/b49fe733-63e0-4972-8b47-3a05c2c8e881.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 7b09f2fc6d823..19a428235dfea 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -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",