From 27f8699607f755f7671d4f3923503ca93a29897f Mon Sep 17 00:00:00 2001 From: andsel Date: Sat, 23 Nov 2024 15:12:25 +0100 Subject: [PATCH] Copy topic and message before release the latch, else the receiver could read null values --- .../io/moquette/integration/mqtt5/SubscriptionOptionsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broker/src/test/java/io/moquette/integration/mqtt5/SubscriptionOptionsTest.java b/broker/src/test/java/io/moquette/integration/mqtt5/SubscriptionOptionsTest.java index ec7479aae..9a5efe5b4 100644 --- a/broker/src/test/java/io/moquette/integration/mqtt5/SubscriptionOptionsTest.java +++ b/broker/src/test/java/io/moquette/integration/mqtt5/SubscriptionOptionsTest.java @@ -58,9 +58,9 @@ static class PublishCollector implements IMqttMessageListener { @Override public void messageArrived(String topic, MqttMessage message) throws Exception { - latch.countDown(); receivedTopic = topic; receivedMessage = message; + latch.countDown(); } public String receivedPayload() {