aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2012-02-14 12:56:30 +0000
committerNick Burch <nick@apache.org>2012-02-14 12:56:30 +0000
commit9e1165c24a8546d9472ef0cd1f1a9cf959013274 (patch)
treee15605cc6cde2ed98116baf08082e7e04e340e7e /src
parent073c3e278fa5355994bb3e9a420797364fa03b2d (diff)
downloadpoi-9e1165c24a8546d9472ef0cd1f1a9cf959013274.tar.gz
poi-9e1165c24a8546d9472ef0cd1f1a9cf959013274.zip
Apply patch from bug #52662 - CharacterRun NPE fix when fetching symbol fonts, where no fonts are defined
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1243907 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/documentation/content/xdocs/status.xml1
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml
index e4022e7a64..a0816adfcf 100644
--- a/src/documentation/content/xdocs/status.xml
+++ b/src/documentation/content/xdocs/status.xml
@@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta6" date="2012-??-??">
+ <action dev="poi-developers" type="fix">52662 - CharacterRun NPE fix when fetching symbol fonts, where no fonts are defined</action>
<action dev="poi-developers" type="add">52658 - support mergin table cells in XSLF</action>
<action dev="poi-developers" type="add">validate row number and column index in SXSSF when creating new rows / cells</action>
<action dev="poi-developers" type="fix">51498 - fixed evaluation of blank cells in COUNTIF</action>
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
index 61be15b668..d049969f75 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
@@ -606,8 +606,13 @@ public final class CharacterRun
public Ffn getSymbolFont()
{
if (isSymbol()) {
+ if (_doc.getFontTable() == null)
+ return null;
+
+ // Fetch all font names
Ffn[] fontNames = _doc.getFontTable().getFontNames();
+ // Try to find the name of the font for our symbol
if (fontNames.length <= _props.getFtcSym())
return null;