]> source.dussan.org Git - poi.git/commitdiff
fix lgtm issues
authorPJ Fanning <fanningpj@apache.org>
Fri, 28 Sep 2018 07:48:29 +0000 (07:48 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 28 Sep 2018 07:48:29 +0000 (07:48 +0000)
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

index 31dac6a468bd13bc22fb54726074e5008cc252ff..3676c3e2ed93a4737e8a8ae3d6a58d012955a07c 100644 (file)
@@ -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);
             }