From 739399b5a5c719f40089f7f266472b968fc40725 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Tue, 8 Jul 2025 21:41:38 -0400 Subject: [PATCH] bugfix: Crash (#1381) ## Description: Resolve a crash caused by un-sanitized user inputs. Fixes #1380. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors Co-authored-by: evanpelle --- src/core/execution/ConstructionExecution.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/execution/ConstructionExecution.ts b/src/core/execution/ConstructionExecution.ts index eddd3f85c..ad7467366 100644 --- a/src/core/execution/ConstructionExecution.ts +++ b/src/core/execution/ConstructionExecution.ts @@ -143,7 +143,10 @@ export class ConstructionExecution implements Execution { this.mg.addExecution(new FactoryExecution(player, this.tile)); break; default: - throw Error(`unit type ${this.constructionType} not supported`); + console.warn( + `unit type ${this.constructionType} cannot be constructed`, + ); + break; } }