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