From: PJ Fanning Date: Fri, 28 Sep 2018 07:48:29 +0000 (+0000) Subject: fix lgtm issues X-Git-Tag: REL_4_0_1~86 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=93af1ca43a9e8239c74fb1801516aefefec29be9;p=poi.git fix lgtm issues git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842218 13f79535-47bb-0310-9956-ffa450edef68 --- 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); }