counter: 1.3.0 - Fixed possible NPE in `Counter10ApplicationIT` counter-1.3.0
authorKai Moritz <kai@juplo.de>
Sat, 8 Jun 2024 17:39:00 +0000 (19:39 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 16 Jun 2024 18:56:52 +0000 (20:56 +0200)
src/test/java/de/juplo/kafka/wordcount/counter/TestData.java

index 54e6287..1ecfdbd 100644 (file)
@@ -92,7 +92,9 @@ class TestData
 
        private static int countMessagesForWord(TestOutputWord word, MultiValueMap<TestOutputWord, TestOutputWordCounter> messagesForUsers)
        {
-               return messagesForUsers.get(word).size();
+               return messagesForUsers.get(word) == null
+                               ? 0
+                               : messagesForUsers.get(word).size();
        }
 
        static void assertExpectedState(ReadOnlyKeyValueStore<Word, Long> store)