https://bz.apache.org/bugzilla/show_bug.cgi?id=63151
Bug ID: 63151 Summary: NPE in UnicodeString.swapFontUse on invoking HSSFOptimiser.optimiseFonts Product: POI Version: 4.0.0-FINAL Hardware: PC Status: NEW Severity: normal Priority: P2 Component: HSSF Assignee: dev@poi.apache.org Reporter: anthonyv...@outlook.com Target Milestone: --- Created attachment 36428 --> https://bz.apache.org/bugzilla/attachment.cgi?id=36428&action=edit A test case to reproduce the issue Please find a reproducer in attachment. This is with Java 11 and POI 4.0.1. The stack trace is: Exception in thread "main" java.lang.NullPointerException at org.apache.poi.hssf.record.common.UnicodeString.swapFontUse(UnicodeString.java:676) at org.apache.poi.hssf.usermodel.HSSFOptimiser.optimiseFonts(HSSFOptimiser.java:155) at ... The problem is fairly obvious: the line loops over the elements of field_4_format_runs without doing a null-check on it first. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org