aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-06-07 09:51:05 +0000
committerPJ Fanning <fanningpj@apache.org>2023-06-07 09:51:05 +0000
commit0ad5f6ac58fe0f21ad4488968b23575b78ea62b6 (patch)
treedec13f39e1b26bf7a4bbaa0f129e704ca0239b62 /poi-ooxml
parent0b116246ddcdd21c5becd7bd33aa60bd9eed2085 (diff)
downloadpoi-0ad5f6ac58fe0f21ad4488968b23575b78ea62b6.tar.gz
poi-0ad5f6ac58fe0f21ad4488968b23575b78ea62b6.zip
improve exception handling
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910273 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java
index 837a844cfb..e7ab8cf48f 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/OOXMLSignatureFacet.java
@@ -173,6 +173,9 @@ public class OOXMLSignatureFacet implements SignatureFacet {
try {
PackagePartName relName = PackagingURIHelper.createPartName(partName);
PackagePart pp2 = opcPackage.getPart(relName);
+ if (pp2 == null) {
+ throw new XMLSignatureException("Failed to find part " + relName);
+ }
contentType = pp2.getContentType();
} catch (InvalidFormatException e) {
throw new XMLSignatureException(e);