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

Prevent breaking errors when an optional content group is undefined (issue 13851)

In the referenced PDF document *most* of the form `/Form` XObjects don't have an `/OC` entry, which thus causes the runtime failure during rendering.
This commit is contained in:
Jonas Jenwald 2021-08-03 15:50:25 +02:00
parent d5302315ce
commit d5e14d3dc3
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}`);