From 590ecb36aef805f5a3c7b465ed08327abf5d961b Mon Sep 17 00:00:00 2001 From: Timothy Stiles Date: Thu, 18 Nov 2021 18:19:57 +1100 Subject: [PATCH] placing a circuit block on a tile shouldn't crash (fixes #78) --- js/editor/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/editor/main.js b/js/editor/main.js index d60a0ac..65ce985 100644 --- a/js/editor/main.js +++ b/js/editor/main.js @@ -1438,7 +1438,7 @@ export class Editor extends PrimaryView { // Special case: preserve wires when replacing one wired tile with another if (new_tile.type.contains_wire && // FIXME this is hacky garbage - tile === this.fg_tile && this.fg_tile_from_palette) + tile === this.fg_tile && this.fg_tile_from_palette && existing_tile !== undefined) { if (existing_tile.type.contains_wire) { new_tile.wire_directions = existing_tile.wire_directions;