From c87bb8aaa495928d51eb4c6fcc4ca03f42bd8c65 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 20 May 2024 21:52:01 +0200 Subject: [PATCH] [sinttest] Ensure that message has body in mucJoinEventOrderingTest() It is possible that messages do not have a body. Therefore, we need to ensure that the message has one before we compare the body. --- .../smackx/muc/MultiUserChatOccupantIntegrationTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java index 1125e320d..077f863c2 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java @@ -86,7 +86,10 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI // Send and wait for the message to have been reflected, so that we can be sure it's part of the MUC history. final SimpleResultSyncPoint messageReflectionSyncPoint = new SimpleResultSyncPoint(); mucAsSeenByOne.addMessageListener(message -> { - if (message.getBody().equals(mucMessage)) { + String body = message.getBody(); + if (body == null) return; + + if (body.equals(mucMessage)) { messageReflectionSyncPoint.signal(); } });