aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Allison <tallison@apache.org>2021-05-07 15:43:04 +0000
committerTim Allison <tallison@apache.org>2021-05-07 15:43:04 +0000
commitb3f53ff0bc640cfbed894fbd7865757696d2a944 (patch)
treeb8d0095e76245391eab14e23a7c84675e7fbb02f
parent841d558018abe8b7fb77b53973c40debd23aecf0 (diff)
downloadpoi-b3f53ff0bc640cfbed894fbd7865757696d2a944.tar.gz
poi-b3f53ff0bc640cfbed894fbd7865757696d2a944.zip
Bug 65293 -- npe in HwmfFont
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889636 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java
index ff64eee42d..c5ea678edc 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java
@@ -410,7 +410,8 @@ public class HwmfFont implements FontInfo, GenericRecord {
pitchAndFamily = leis.readUByte();
StringBuilder sb = new StringBuilder();
- int readBytes = readString(leis, sb, 32, charSet.getCharset());
+ Charset actualCharset = (charSet == null) ? null : charSet.getCharset();
+ int readBytes = readString(leis, sb, 32, actualCharset);
if (readBytes == -1) {
throw new IOException("Font facename can't be determined.");
}