Skip to content

Commit bf553f2

Browse files
committed
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.
1 parent 76f23ce commit bf553f2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/core/struct_tree.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,10 @@ class StructTreePage {
757757

758758
const parent = dict.get("P");
759759

760-
if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {
760+
if (
761+
!(parent instanceof Dict) ||
762+
isName(parent.get("Type"), "StructTreeRoot")
763+
) {
761764
if (!this.addTopLevelNode(dict, element)) {
762765
map.delete(dict);
763766
}

0 commit comments

Comments
 (0)