[SquadServer][1] Failed to update layer information. TypeError: Cannot read properties of null (reading '1')
at SquadRcon.getNextMap (file:///home/container/squad-server/rcon.js:129:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SquadServer.updateLayerInformation (file:///home/container/squad-server/index.js:452:23)
V8 Updates some RCON Commands it seems
async getNextMap() {
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
};
}
the new response from ShowNextMap is Next map is not defined
Therefore match ends up being null which broke the return values.
Updated to this seems to work for me so far:
async getNextMap() {
const response = await this.execute('ShowNextMap');
const match = response.match(/^Next level is (.*), layer is (.*)/);
return {
level: match ? (match[1] !== '' ? match[1] : null) : null,
layer: match ? (match[2] !== 'To be voted' ? match[2] : null) : null
};
}
V8 Updates some RCON Commands it seems
the new response from ShowNextMap is
Next map is not defined
Therefore match ends up beingnull
which broke the return values.Updated to this seems to work for me so far: