aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-07-14 11:26:56 +0000
committerDominik Stadler <centic@apache.org>2024-07-14 11:26:56 +0000
commita0421651334ce1344b6085274ab4a7284a266bf5 (patch)
treeefd83aaaf3bede53389a3bfa9d8cdf052a414217 /poi-ooxml
parentfc17f113d8a14341bc753231877d0d9b3c312118 (diff)
downloadpoi-a0421651334ce1344b6085274ab4a7284a266bf5.tar.gz
poi-a0421651334ce1344b6085274ab4a7284a266bf5.zip
Bug 66425: Avoid exceptions found via poi-fuzz
Prevent a NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68104 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
index 7bc97dd79f..315c5921b4 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
@@ -27,6 +27,8 @@ import java.util.Map;
import com.microsoft.schemas.office.visio.x2012.main.MasterType;
import com.microsoft.schemas.office.visio.x2012.main.MastersDocument;
import com.microsoft.schemas.office.visio.x2012.main.MastersType;
+import com.microsoft.schemas.office.visio.x2012.main.RelType;
+
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.ooxml.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
@@ -68,7 +70,10 @@ public class XDGFMasters extends XDGFXMLDocumentPart {
Map<String, MasterType> masterSettings = new HashMap<>();
for (MasterType master: _mastersObject.getMasterArray()) {
- masterSettings.put(master.getRel().getId(), master);
+ RelType rel = master.getRel();
+ if (rel != null) {
+ masterSettings.put(rel.getId(), master);
+ }
}
// create the masters