1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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}`);