mirror of
https://codeberg.org/spire/webrcon.git
synced 2026-06-03 09:14:06 +02:00
Merge pull request #2 from jpJuni0r/socket-disconnect
Fix error when disconnecting from non-open socket
This commit is contained in:
commit
4b23e0ec80
2 changed files with 4 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"description": "Create rcon connections using websockets",
|
||||
"author": "Robin Appelman <robin@icewind.nl>",
|
||||
"license": "MIT",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"main": "lib/rcon.js",
|
||||
"scripts": {
|
||||
"build": "babel src --out-dir lib"
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ export default class WebRcon extends EventEmitter {
|
|||
}
|
||||
|
||||
disconnect () {
|
||||
this.socket.disconnect();
|
||||
if (this.socket && this.socket.disconnect) {
|
||||
this.socket.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue