diff --git a/validation-model/src/main/java/org/verapdf/gf/model/factory/operators/OperatorParser.java b/validation-model/src/main/java/org/verapdf/gf/model/factory/operators/OperatorParser.java index e55e6581c..7168a4cc6 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/factory/operators/OperatorParser.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/factory/operators/OperatorParser.java @@ -695,7 +695,7 @@ private COSObject getParentStructElem(StructureElementAccessObject structureElem if (structTreeRoot != null) { PDNumberTreeNode parentTreeRoot = structTreeRoot.getParentTree(); COSObject structureElement = parentTreeRoot == null ? null : structureElementAccessObject.getStructureElement(parentTreeRoot, mcid); - if (structureElement != null && !structureElement.empty()) { + if (structureElement != null && !structureElement.empty() && structureElement.getType() != COSObjType.COS_NULL) { return structureElement; } } diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/operator/markedcontent/GFOp_BDC.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/operator/markedcontent/GFOp_BDC.java index 8f540fdc8..08aef48af 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/operator/markedcontent/GFOp_BDC.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/operator/markedcontent/GFOp_BDC.java @@ -23,6 +23,7 @@ import org.verapdf.as.ASAtom; import org.verapdf.cos.COSBase; import org.verapdf.cos.COSKey; +import org.verapdf.cos.COSObjType; import org.verapdf.cos.COSObject; import org.verapdf.exceptions.LoopedException; import org.verapdf.gf.model.impl.pd.util.PDResourcesHandler; @@ -80,7 +81,7 @@ private COSObject getStructElem() { if (structTreeRoot != null && mcid != null) { PDNumberTreeNode parentTreeRoot = structTreeRoot.getParentTree(); COSObject structureElement = parentTreeRoot == null ? null : structureElementAccessObject.getStructureElement(parentTreeRoot, mcid); - if (structureElement != null && !structureElement.empty()) { + if (structureElement != null && !structureElement.empty() && structureElement.getType() != COSObjType.COS_NULL) { return structureElement; } } diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDContentStream.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDContentStream.java index 9b07b607d..7751af72d 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDContentStream.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDContentStream.java @@ -203,7 +203,7 @@ private COSObject getParentStructureElem(StructureElementAccessObject structureE if (structTreeRoot != null) { PDNumberTreeNode parentTreeRoot = structTreeRoot.getParentTree(); COSObject structureElement = parentTreeRoot == null ? null : structureElementAccessObject.getStructureElement(parentTreeRoot, null); - if (structureElement != null && !structureElement.empty()) { + if (structureElement != null && !structureElement.empty() && structureElement.getType() != COSObjType.COS_NULL) { return structureElement; } }