diff --git a/modules/rcon.js b/modules/rcon.js index 25d383f..dfede38 100644 --- a/modules/rcon.js +++ b/modules/rcon.js @@ -65,7 +65,7 @@ class RconManager { async disconnect_rcon(server_id) { console.log('starting disconnect', server_id) - if (!this.rcons[server_id].connected) { + if ( !(server_id in this.rcons) || (!this.rcons[server_id].connected)) { return Promise.resolve(); } diff --git a/readme.md b/readme.md index 3f022ac..810540a 100644 --- a/readme.md +++ b/readme.md @@ -21,7 +21,7 @@ A simple web panel to control CS2 servers via RCON - Add teams and players - Add password option while setting up the server - Improve UX/UI -- Improve/clean code +- Improve/clean code (This is my first time working with node :P) - Create executable ## Limitations