aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2024-04-19 10:16:08 +0000
committerPJ Fanning <fanningpj@apache.org>2024-04-19 10:16:08 +0000
commitff7f1ea72112a58180465a9b342eeb09cee8096e (patch)
treef0a814b1675d36e469b79111253a562f74fc3bb0 /poi-ooxml
parenta0091652a5810adb6f3e19f339ccec5feeaa2cac (diff)
downloadpoi-ff7f1ea72112a58180465a9b342eeb09cee8096e.tar.gz
poi-ff7f1ea72112a58180465a9b342eeb09cee8096e.zip
fix npe
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePartName.java3
1 files changed, 2 insertions, 1 deletions
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<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
+ "$");