diff --git a/package.json b/package.json index 97252651..ae90fe46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SquadJS", - "version": "4.0.1", + "version": "4.1.0", "repository": "https://github.com/Team-Silver-Sphere/SquadJS.git", "author": "Thomas Smyth ", "license": "BSL-1.0", diff --git a/squad-server/rcon.js b/squad-server/rcon.js index 29626529..8398f09f 100644 --- a/squad-server/rcon.js +++ b/squad-server/rcon.js @@ -126,8 +126,8 @@ export default class SquadRcon extends Rcon { const response = await this.execute('ShowNextMap'); const match = response.match(/^Next level is (.*), layer is (.*)/); return { - level: match[1] !== '' ? match[1] : null, - layer: match[2] !== 'To be voted' ? match[2] : null + level: match ? (match[1] !== '' ? match[1] : null) : null, + layer: match ? (match[2] !== 'To be voted' ? match[2] : null) : null }; }