diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java index 14d5fbd9e8..fbe4f58822 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java @@ -136,7 +136,7 @@ public class FromHowTo { if(nextIsString && StringUtil.isNotBlank(lastContents)) { Integer idx = Integer.valueOf(lastContents); lastContents = lruCache.get(idx); - if (lastContents == null && !lruCache.containsKey(idx)) { + if (lastContents == null && !lruCache.containsKey(idx) && sst != null) { lastContents = sst.getItemAt(idx).getString(); lruCache.put(idx, lastContents); } diff --git a/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx b/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx new file mode 100644 index 0000000000..7b30e5ca9d Binary files /dev/null and b/test-data/spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx differ diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 1e6d98a3a8..f32cb34e16 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ