From: Kai Moritz Date: Sat, 8 Jun 2024 17:35:21 +0000 (+0200) Subject: top10: 1.2.1 - Fixed possible NPE in `Top10ApplicationIT` X-Git-Tag: top10-1.2.1~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=8dfd8ee1b26d8d95e95402d9ba2128a113181396;p=demos%2Fkafka%2Fwordcount top10: 1.2.1 - Fixed possible NPE in `Top10ApplicationIT` --- diff --git a/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java b/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java index 84c81f5..cf52c1f 100644 --- a/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java @@ -85,7 +85,9 @@ class TestData static int countMessagesForUser(TestUser user, MultiValueMap messagesForUsers) { - return messagesForUsers.get(user).size(); + return messagesForUsers.get(user) == null + ? 0 + : messagesForUsers.get(user).size(); }