From: PJ Fanning Date: Fri, 19 Apr 2024 10:16:08 +0000 (+0000) Subject: fix npe X-Git-Tag: REL_5_3_0~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff7f1ea72112a58180465a9b342eeb09cee8096e;p=poi.git fix npe git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917139 13f79535-47bb-0310-9956-ffa450edef68 --- 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 + "$");