From 5aa03935c0d09c363dc2b3ddcbd5fc9aac93b8e1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 8 Jun 2024 19:39:00 +0200 Subject: [PATCH] counter: 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