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

Ensure that the field value, for checkboxes, refers to an existing appearance state (bug 1720411)

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1720411
This commit is contained in:
Jonas Jenwald 2021-07-14 19:31:09 +02:00
parent f1ae7d7b0e
commit da808aeab3
4 changed files with 26 additions and 12 deletions

View file

@ -2075,6 +2075,11 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
// The /Off appearance is optional.
exportValues.push("Off");
}
// Don't use a "V" entry pointing to a non-existent appearance state,
// see e.g. bug1720411.pdf where it's an *empty* Name-instance.
if (!exportValues.includes(this.data.fieldValue)) {
this.data.fieldValue = null;
}
if (exportValues.length !== 2) {
return;
}