]> source.dussan.org Git - poi.git/commitdiff
Bug 65293 -- npe in HwmfFont
authorTim Allison <tallison@apache.org>
Fri, 7 May 2021 15:43:04 +0000 (15:43 +0000)
committerTim Allison <tallison@apache.org>
Fri, 7 May 2021 15:43:04 +0000 (15:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889636 13f79535-47bb-0310-9956-ffa450edef68

poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfFont.java

index ff64eee42d4a725592d6e48bbca298ed04144c61..c5ea678edc38bdf6049961cc8fe7d0ebee263e37 100644 (file)
@@ -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.");
         }