mirror of https://github.com/apache/poi.git
Bug 66425: Avoid exceptions found via poi-fuzz
Prevent a NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65448 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c101982e0
commit
d4bcc2b3bb
|
@ -127,10 +127,13 @@ public class XWPFFootnotes extends XWPFAbstractFootnotesEndnotes {
|
||||||
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
|
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
|
||||||
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTFootnotes.type.getName().getNamespaceURI(), "footnotes"));
|
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTFootnotes.type.getName().getNamespaceURI(), "footnotes"));
|
||||||
PackagePart part = getPackagePart();
|
PackagePart part = getPackagePart();
|
||||||
|
|
||||||
|
if (ctFootnotes != null) {
|
||||||
try (OutputStream out = part.getOutputStream()) {
|
try (OutputStream out = part.getOutputStream()) {
|
||||||
ctFootnotes.save(out, xmlOptions);
|
ctFootnotes.save(out, xmlOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an {@link XWPFFootnote} to the document
|
* Add an {@link XWPFFootnote} to the document
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue