From a0091652a5810adb6f3e19f339ccec5feeaa2cac Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 19 Apr 2024 10:12:44 +0000 Subject: [PATCH] fix npe git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917138 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java index 82cf69b32d..6d04232947 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java @@ -165,7 +165,9 @@ public final class PackagingURIHelper { if (partUri == null) throw new IllegalArgumentException("partUri"); - return partUri.getPath().matches( + final String path = partUri.getPath(); + + return path != null && path.matches( ".*" + RELATIONSHIP_PART_SEGMENT_NAME + ".*" + RELATIONSHIP_PART_EXTENSION_NAME + "$"); } -- 2.39.5