top10: 1.2.1 - Fixed possible NPE in `Top10ApplicationIT`
authorKai Moritz <kai@juplo.de>
Sat, 8 Jun 2024 17:35:21 +0000 (19:35 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 8 Jun 2024 17:35:21 +0000 (19:35 +0200)
src/test/java/de/juplo/kafka/wordcount/top10/TestData.java

index 84c81f5..cf52c1f 100644 (file)
@@ -85,7 +85,9 @@ class TestData
 
        static int countMessagesForUser(TestUser user, MultiValueMap<TestUser, TestRanking> messagesForUsers)
        {
-               return messagesForUsers.get(user).size();
+               return messagesForUsers.get(user) == null
+                               ? 0
+                               : messagesForUsers.get(user).size();
        }