mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Skip fieldObjects
that are not actually References
The `fieldObjects`-getter is implemented in the `PDFDocument` class, which means that the `this._localIdFactory`-property that we pass to `AnnotationFactory.create` doesn't actually exist. The reason that this hasn't caused any bugs, that I'm aware of, is that all /Fields-entries need to be References to actually make sense.
This commit is contained in:
parent
65c827b0eb
commit
ff62fc8e2c
1 changed files with 5 additions and 2 deletions
|
@ -1714,7 +1714,10 @@ class PDFDocument {
|
|||
async #collectFieldObjects(name, fieldRef, promises, annotationGlobals) {
|
||||
const { xref } = this;
|
||||
|
||||
const field = await xref.fetchIfRefAsync(fieldRef);
|
||||
if (!(fieldRef instanceof Ref)) {
|
||||
return;
|
||||
}
|
||||
const field = await xref.fetchAsync(fieldRef);
|
||||
if (!(field instanceof Dict)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1731,7 +1734,7 @@ class PDFDocument {
|
|||
xref,
|
||||
fieldRef,
|
||||
annotationGlobals,
|
||||
this._localIdFactory,
|
||||
/* idFactory = */ null,
|
||||
/* collectFields */ true,
|
||||
/* pageRef */ null
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue