From 51637fcc435f1a65edd08f30df1d71824b95843c Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 17 Apr 2024 18:15:33 +0000 Subject: Bug 66425: Avoid exceptions found via poi-fuzz Prevent a few NullPointerException Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66400 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917068 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'poi-examples/src/main') 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); } -- cgit v1.2.3