online multiplayer chess game (note server currently down)
-rw-r--r--Utils.gd2
1 files changed, 1 insertions, 1 deletions
diff --git a/Utils.gd b/Utils.gd
index 811f322..7d721cc 100644
--- a/Utils.gd
+++ b/Utils.gd
@@ -93,7 +93,7 @@ func fen() -> String:
var spot = Globals.grid.matrix[rank][file]
if spot == null:
empty += 1
- if str(empty - 1) == pieces[-1]:
+ if pieces.size() > 0 and str(empty - 1) == pieces[-1]:
pieces[-1] = str(empty)
else:
pieces += str(empty)