From 93af1ca43a9e8239c74fb1801516aefefec29be9 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 28 Sep 2018 07:48:29 +0000 Subject: [PATCH] fix lgtm issues git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842218 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java b/src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java index 31dac6a468..3676c3e2ed 100644 --- a/src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java +++ b/src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java @@ -223,7 +223,7 @@ public class POIXMLProperties { throw new POIXMLException(e); } } - if(extPart != null){ + if(extPart != null && ext != null && ext.props != null){ try (OutputStream out = extPart.getOutputStream()) { if (extPart.getSize() > 0) { extPart.clear(); @@ -231,7 +231,7 @@ public class POIXMLProperties { ext.props.save(out, DEFAULT_XML_OPTIONS); } } - if(custPart != null){ + if(custPart != null && cust != null && cust.props != null){ try (OutputStream out = custPart.getOutputStream()) { cust.props.save(out, DEFAULT_XML_OPTIONS); }