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
This commit is contained in:
Nick Burch 2012-02-14 12:56:30 +00:00
parent 1ed2118402
commit 441c441ac8
2 changed files with 6 additions and 0 deletions

View File

@ -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>

View File

@ -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;