From: Kai Moritz Date: Sat, 8 Jun 2024 17:39:00 +0000 (+0200) Subject: couter: 1.3.0 - Fixed possible NPE in `Counter10ApplicationIT` X-Git-Tag: popular-on-counter~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=140800c53f2422665602b8c38d2d8fe0a5d6730b;p=demos%2Fkafka%2Fwordcount couter: 1.3.0 - Fixed possible NPE in `Counter10ApplicationIT` --- 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)