From 67a6cb9392e857b4a02260d291ee0179f1281e30 Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 23 Feb 2024 11:48:34 +0300 Subject: [PATCH] Fix NullPointerException --- .../src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java index 63dc91a7..477abb42 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java @@ -268,7 +268,7 @@ public String getstructParentType() { PDNumberTreeNode parentTreeRoot = structTreeRoot.getParentTree(); COSBase structureElement = null; try { - PDParentTreeValue treeValue = (PDParentTreeValue)parentTreeRoot.getValue(structParent); + PDParentTreeValue treeValue = parentTreeRoot != null ? (PDParentTreeValue)parentTreeRoot.getValue(structParent) : null; if (treeValue != null) { structureElement = treeValue.getCOSObject(); }