From 73fe53c0be247bb94fbe9c8a2a0f287b1a15a50d Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Mon, 4 Jul 2011 19:04:26 +0000 Subject: [PATCH] workaround for NPE caused by old Word format git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142762 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/usermodel/CharacterRun.java | 4 ++++ 1 file changed, 4 insertions(+) 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 3b3898e6fc..02068d0471 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java @@ -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()); } -- 2.39.5