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:
parent
d5302315ce
commit
d5e14d3dc3
3 changed files with 12 additions and 0 deletions
|
@ -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}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue