]> source.dussan.org Git - poi.git/commitdiff
fix npe
authorPJ Fanning <fanningpj@apache.org>
Fri, 19 Apr 2024 10:16:08 +0000 (10:16 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 19 Apr 2024 10:16:08 +0000 (10:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917139 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java

index 43853dd3b72a8589abfca9ca2f855ad0fbe349ee..14a1ee56cc704fc316be92eb16bb2d989d564f68 100644 (file)
@@ -139,7 +139,8 @@ public final class PackagePartName implements Comparable<PackagePartName> {
             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
                         + "$");