From 4fcd7ab062f5250757804d633df01bd0d06da137 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Thu, 4 Jan 2024 10:23:47 +0100
Subject: [PATCH] Fix Discoduel

---
 variants/Discoduel/class.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/variants/Discoduel/class.js b/variants/Discoduel/class.js
index c081b31..ec96a43 100644
--- a/variants/Discoduel/class.js
+++ b/variants/Discoduel/class.js
@@ -38,7 +38,9 @@ export default class DiscoduelRules extends ChessRules {
     // No real winning condition (promotions count...)
     if (
       ArrayFun.range(1, this.size.x).every(row_idx => {
-        this.board[row_idx].every(square => square.charAt(0) != 'w')
+        return this.board[row_idx].every(square => {
+          return (!square || square.charAt(0) != 'w');
+        })
       })
       ||
       !this.atLeastOneMove(this.turn)
-- 
2.44.0