From 51cd3f9b85491763e96b1b5d07a76c69541fb2b8 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 10 May 2024 21:21:42 +0200 Subject: [PATCH] [sinttest] prevent NullPointerException in RosterIntegrationTest When listening for a presence stanza, assuming that every stanza will have a 'status' can cause NullPointerExceptions to be logged. This commit prevents that. --- .../org/jivesoftware/smack/roster/RosterIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java index 091293c4d1..48621b2400 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java @@ -412,7 +412,7 @@ public void testCurrentPresenceSentAfterSubscriptionApproval() throws Exception final SimpleResultSyncPoint received = new SimpleResultSyncPoint(); final StanzaListener stanzaListener = stanza -> { final Presence presence = (Presence) stanza; - if (presence.getStatus().equals(needle)) { + if (needle.equals(presence.getStatus())) { received.signal(); } };