Merge pull request #13854 from Snuffleupagus/issue-13851

Prevent breaking errors when an optional content group is undefined (issue 13851)
This commit is contained in:
Tim van der Meij 2021-08-03 23:34:34 +02:00 committed by GitHub
commit 85be62c684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -95,6 +95,10 @@ class OptionalContentConfig {
}
isVisible(group) {
if (!group) {
warn("Optional content group not defined.");
return true;
}
if (group.type === "OCG") {
if (!this._groups.has(group.id)) {
warn(`Optional content group not found: ${group.id}`);

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/6896539/doc_image.pdf

View File

@ -3688,6 +3688,13 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue13851",
"file": "pdfs/issue13851.pdf",
"md5": "d933d397c4efc80faba856bf8deafc1a",
"rounds": 1,
"link": true,
"type": "eq"
},
{ "id": "issue1655",
"file": "pdfs/issue1655r.pdf",
"md5": "569f48449ba57c15c4f9ade151a651c5",