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 #13735 from Snuffleupagus/bug-1720411

Ensure that the field value, for checkboxes, refers to an existing appearance state (bug 1720411)
This commit is contained in:
Tim van der Meij 2021-07-18 13:48:34 +02:00 committed by GitHub
commit 07955fa1d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 12 deletions

View file

@ -2082,6 +2082,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;
}