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."); }