From 1cf45ac91340e3a582a6ac9995706518345ff889 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Wed, 14 May 2025 22:15:18 -0400 Subject: [PATCH] src/core/execution/SAMLauncherExecution.ts --- src/core/execution/SAMLauncherExecution.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/execution/SAMLauncherExecution.ts b/src/core/execution/SAMLauncherExecution.ts index 92ced26d9..f16731fb8 100644 --- a/src/core/execution/SAMLauncherExecution.ts +++ b/src/core/execution/SAMLauncherExecution.ts @@ -27,7 +27,7 @@ export class SAMLauncherExecution implements Execution { constructor( private ownerId: PlayerID, - private tile: TileRef, + private tile: TileRef | null, private sam: Unit | null = null, ) { if (sam !== null) { @@ -97,6 +97,9 @@ export class SAMLauncherExecution implements Execution { throw new Error("Not initialized"); } if (this.sam === null) { + if (this.tile === null) { + throw new Error("tile is null"); + } const spawnTile = this.player.canBuild(UnitType.SAMLauncher, this.tile); if (spawnTile === false) { consolex.warn("cannot build SAM Launcher");