From ff7f1ea72112a58180465a9b342eeb09cee8096e Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 19 Apr 2024 10:16:08 +0000 Subject: [PATCH] fix npe git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917139 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/openxml4j/opc/PackagePartName.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java index 43853dd3b7..14a1ee56cc 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java @@ -139,7 +139,8 @@ public final class PackagePartName implements Comparable { throw new IllegalArgumentException("partUri"); } - return partUri.getPath().matches( + final String uriPath = partUri.getPath(); + return uriPath != null && uriPath.matches( "^.*/" + PackagingURIHelper.RELATIONSHIP_PART_SEGMENT_NAME + "/.*\\" + PackagingURIHelper.RELATIONSHIP_PART_EXTENSION_NAME + "$"); -- 2.39.5