Fix NPE with null session in MQTTConnectionManager.disconnect()

This commit is contained in:
Ville Skyttä 2016-07-28 23:23:40 +03:00
parent a6a03d4985
commit 9963f96033
1 changed files with 4 additions and 1 deletions

View File

@ -106,8 +106,11 @@ public class MQTTConnectionManager {
}
void disconnect() {
if (session == null) {
return;
}
try {
if (session != null && session.getSessionState() != null) {
if (session.getSessionState() != null) {
String clientId = session.getSessionState().getClientId();
if (clientId != null)
CONNECTED_CLIENTS.remove(clientId);