fix lgtm issues

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842218 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-09-28 07:48:29 +00:00
parent b3f0d80eb6
commit 93af1ca43a
1 changed files with 2 additions and 2 deletions

View 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);
}