From 140800c53f2422665602b8c38d2d8fe0a5d6730b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 8 Jun 2024 19:39:00 +0200 Subject: [PATCH] couter: 1.3.0 - Fixed possible NPE in `Counter10ApplicationIT` --- src/test/java/de/juplo/kafka/wordcount/counter/TestData.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java b/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java index 54e6287..1ecfdbd 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java @@ -92,7 +92,9 @@ class TestData private static int countMessagesForWord(TestOutputWord word, MultiValueMap messagesForUsers) { - return messagesForUsers.get(word).size(); + return messagesForUsers.get(word) == null + ? 0 + : messagesForUsers.get(word).size(); } static void assertExpectedState(ReadOnlyKeyValueStore store) -- 2.20.1