mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Ensure that the /P-entry is actually a dictionary in StructTreePage.prototype.addNode
This may fix issue 19822, but without a test-case it's simply impossible to know for sure.
This commit is contained in:
parent
76f23ce3b5
commit
bf553f22da
1 changed files with 4 additions and 1 deletions
|
@ -757,7 +757,10 @@ class StructTreePage {
|
|||
|
||||
const parent = dict.get("P");
|
||||
|
||||
if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {
|
||||
if (
|
||||
!(parent instanceof Dict) ||
|
||||
isName(parent.get("Type"), "StructTreeRoot")
|
||||
) {
|
||||
if (!this.addTopLevelNode(dict, element)) {
|
||||
map.delete(dict);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue