From 40cd223d6b65cd244aee434cc88950ea43da4af9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sun, 8 Jun 2025 11:03:40 -0400 Subject: [PATCH] Fix bug in FakeHumanExecution (#1102) ## Description: Fix a bug causing an exception to be thrown which crashes the game. ## 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 - [ ] 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: Scott Anderson <662325+scottanderson@users.noreply.github.com> --- src/core/execution/FakeHumanExecution.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index 90d129b96..2314ce747 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -470,6 +470,7 @@ export class FakeHumanExecution implements Execution { this.mg.isOceanShore(t), ) : Array.from(this.player.tiles()); + if (tiles.length === 0) return null; return this.random.randElement(tiles); }