Skip to content

Commit

Permalink
Bug 66425: Avoid NullPointerExceptions found via poi-fuzz
Browse files Browse the repository at this point in the history
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-ffa450edef68
  • Loading branch information
centic9 committed Sep 14, 2023
1 parent cc4ccba commit e9b860f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1430,8 +1430,9 @@ private void _getText(XmlObject o, StringBuilder text) {
}
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);
}
}
Expand Down
Binary file not shown.

0 comments on commit e9b860f

Please sign in to comment.