]> source.dussan.org Git - poi.git/commitdiff
workaround for NPE caused by old Word format
authorSergey Vladimirov <sergey@apache.org>
Mon, 4 Jul 2011 19:04:26 +0000 (19:04 +0000)
committerSergey Vladimirov <sergey@apache.org>
Mon, 4 Jul 2011 19:04:26 +0000 (19:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142762 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java

index 3b3898e6fc486c0f7e9d4d85dec79cb60ff6fa20..02068d0471c8688608ee3714dc1f529ef8b23ad7 100644 (file)
@@ -426,6 +426,10 @@ public final class CharacterRun
 
   public String getFontName()
   {
+    if (_doc.getFontTable() == null)
+      // old word format
+      return null;
+
     return _doc.getFontTable().getMainFont(_props.getFtcAscii());
   }