From 3749f524f5205b11aec0d7f98fa0ed3310f12f04 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 21 May 2024 13:06:58 +0200 Subject: [PATCH] [sinttest] Fix NPE by checking that status is not null testCurrentPresenceSentAfterSubscriptionApproval() --- .../jivesoftware/smack/roster/RosterIntegrationTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 091293c4d..28dff0ebf 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 @@ -1,6 +1,6 @@ /** * - * Copyright 2015-2020 Florian Schmaus, 2022-2024 Guus der Kinderen + * Copyright 2015-2024 Florian Schmaus, 2022-2024 Guus der Kinderen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -412,7 +412,11 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest { final SimpleResultSyncPoint received = new SimpleResultSyncPoint(); final StanzaListener stanzaListener = stanza -> { final Presence presence = (Presence) stanza; - if (presence.getStatus().equals(needle)) { + + String status = presence.getStatus(); + if (status == null) return; + + if (status.equals(needle)) { received.signal(); } };