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:
commit
85be62c684
@ -95,6 +95,10 @@ class OptionalContentConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isVisible(group) {
|
isVisible(group) {
|
||||||
|
if (!group) {
|
||||||
|
warn("Optional content group not defined.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (group.type === "OCG") {
|
if (group.type === "OCG") {
|
||||||
if (!this._groups.has(group.id)) {
|
if (!this._groups.has(group.id)) {
|
||||||
warn(`Optional content group not found: ${group.id}`);
|
warn(`Optional content group not found: ${group.id}`);
|
||||||
|
1
test/pdfs/issue13851.pdf.link
Normal file
1
test/pdfs/issue13851.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/mozilla/pdf.js/files/6896539/doc_image.pdf
|
@ -3688,6 +3688,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue13851",
|
||||||
|
"file": "pdfs/issue13851.pdf",
|
||||||
|
"md5": "d933d397c4efc80faba856bf8deafc1a",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue1655",
|
{ "id": "issue1655",
|
||||||
"file": "pdfs/issue1655r.pdf",
|
"file": "pdfs/issue1655r.pdf",
|
||||||
"md5": "569f48449ba57c15c4f9ade151a651c5",
|
"md5": "569f48449ba57c15c4f9ade151a651c5",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user