From 8dfd8ee1b26d8d95e95402d9ba2128a113181396 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 8 Jun 2024 19:35:21 +0200 Subject: [PATCH] top10: 1.2.1 - Fixed possible NPE in `Top10ApplicationIT` --- src/test/java/de/juplo/kafka/wordcount/top10/TestData.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } -- 2.20.1