fix(disconnect) Fix quick disconnect errors

This commit is contained in:
Tudor-Ovidiu Avram 2020-07-15 15:18:03 +03:00 committed by Saúl Ibarra Corretgé
parent 36d95ed51f
commit 1790c71c80
1 changed files with 4 additions and 0 deletions

View File

@ -411,6 +411,10 @@ function disconnect() {
return Promise.resolve();
};
if (!connection) {
return onDisconnected();
}
return connection.disconnect().then(onDisconnected, onDisconnected);
}