ARTEMIS-1952 NPE logged at warn if MQTT subscriber disconnects abruptly
Prevent a NullPointerException if no connection by the given clientId is found on the cache of stored sessions
This commit is contained in:
parent
951a061555
commit
16909584c3
|
@ -179,7 +179,13 @@ class MQTTProtocolManager extends AbstractProtocolManager<MqttMessage, MQTTInter
|
|||
}
|
||||
|
||||
public boolean isClientConnected(String clientId, MQTTConnection connection) {
|
||||
return connectedClients.get(clientId).equals(connection);
|
||||
MQTTConnection connectedConn = connectedClients.get(clientId);
|
||||
|
||||
if (connectedConn != null) {
|
||||
return connectedConn.equals(connection);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void removeConnectedClient(String clientId) {
|
||||
|
|
Loading…
Reference in New Issue