We try to avoid throwing NullPointerException, but it was possible to trigger one here git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912303 13f79535-47bb-0310-9956-ffa450edef68tags/REL_5_2_4
@@ -1430,8 +1430,9 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { | |||
} | |||
if (o instanceof CTFtnEdnRef) { | |||
CTFtnEdnRef ftn = (CTFtnEdnRef) o; | |||
final int i = ftn.getId() == null ? -1 : ftn.getId().intValue(); | |||
String footnoteRef = ftn.getDomNode().getLocalName().equals("footnoteReference") ? | |||
"[footnoteRef:" + ftn.getId().intValue() + "]" : "[endnoteRef:" + ftn.getId().intValue() + "]"; | |||
"[footnoteRef:" + i + "]" : "[endnoteRef:" + i + "]"; | |||
text.append(footnoteRef); | |||
} | |||
} |