mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Avoid NPE with broken files when writing endnotes for Word documents
Fixes https://issues.oss-fuzz.com/issues/392690733
This commit is contained in:
parent
befc941dcf
commit
e9b33c0b08
@ -123,6 +123,11 @@ public class XWPFEndnotes extends XWPFAbstractFootnotesEndnotes {
|
||||
|
||||
@Override
|
||||
protected void commit() throws IOException {
|
||||
// cannot save anything if class is not initialized fully
|
||||
if (ctEndnotes == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
|
||||
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTEndnotes.type.getName().getNamespaceURI(), "endnotes"));
|
||||
PackagePart part = getPackagePart();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user