1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

[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.
This commit is contained in:
Florian Schmaus 2024-05-20 21:52:01 +02:00
parent 9447030cd4
commit c87bb8aaa4

View file

@ -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. // 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(); final SimpleResultSyncPoint messageReflectionSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByOne.addMessageListener(message -> { mucAsSeenByOne.addMessageListener(message -> {
if (message.getBody().equals(mucMessage)) { String body = message.getBody();
if (body == null) return;
if (body.equals(mucMessage)) {
messageReflectionSyncPoint.signal(); messageReflectionSyncPoint.signal();
} }
}); });