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 <evanpelle@gmail.com>
This commit is contained in:
Scott Anderson
2025-07-08 21:41:38 -04:00
committed by GitHub
parent 2e442c9c29
commit 739399b5a5
+4 -1
View File
@@ -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;
}
}