return if calling disconnect more than once in websocket

This commit is contained in:
Salvatore Giordano
2021-01-26 10:26:39 +01:00
parent e39daa0d6e
commit a8c44829b4
@@ -290,6 +290,9 @@ class WebSocket {
/// Disconnects the WS and releases eventual resources
Future<void> disconnect() {
if (_manuallyClosed) {
return Future.value();
}
logger.info('disconnecting');
_connectionCompleter = Completer();
_cancelTimers();