diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java index d626350298..c6bca6d5ad 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractFootnotesEndnotes.java @@ -57,8 +57,10 @@ public abstract class XWPFAbstractFootnotesEndnotes extends POIXMLDocumentPart { public XWPFAbstractFootnoteEndnote getFootnoteById(int id) { for (XWPFAbstractFootnoteEndnote note : listFootnote) { - if (note.getCTFtnEdn().getId().intValue() == id) + if (note.getCTFtnEdn().getId() != null && + note.getCTFtnEdn().getId().intValue() == id) { return note; + } } return null; } diff --git a/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx b/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx new file mode 100644 index 0000000000..6947f6fbec Binary files /dev/null and b/test-data/document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5569740188549120.docx differ