Fix error when disconnecting from non-open socket

This commit is contained in:
Jan-Philipp Ottmüller 2017-04-14 23:22:15 +02:00
commit f976c757ee
2 changed files with 4 additions and 2 deletions

View file

@ -64,6 +64,8 @@ export default class WebRcon extends EventEmitter {
}
disconnect () {
this.socket.disconnect();
if (this.socket && this.socket.disconnect) {
this.socket.disconnect();
}
}
}