From e2b1d4d0c673de7d69504f8cbfa8ea7b9ff4203c Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 27 May 2023 19:02:30 +0100 Subject: [PATCH] null guard against a map without a base json inside fixBrokenOfflineMapWaves() --- project/src/controllers/GameController.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index a3f9b9b4..e643fae0 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -279,6 +279,12 @@ export class GameController // Loop over all of the locations waves and look for waves with identical min and max slots const location: ILocationData = this.databaseServer.getTables().locations[locationKey]; + if (!location.base) + { + this.logger.warning(`Map ${locationKey} lacks a base json, skipping map wave fixes`); + continue; + } + for (const wave of location.base.waves) { if ((wave.slots_max - wave.slots_min === 0))