avoid error when currentPlayer is not set
authorLaurent Mazet <mazet@softndesign.org>
Sun, 18 Oct 2020 18:49:12 +0000 (20:49 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sun, 18 Oct 2020 18:49:12 +0000 (20:49 +0200)
public/trivabble.js

index 2100d7d6c15436f99d5969abad3e52f08a5df6f1..9a56fd0f09437c86d414a2fe5463e41885c1ef0b 100644 (file)
         myConfirm(
             _("Do you want to add score to active player?") + " " + totalScore,
             function () {
+                if (currentPlayer === "") {
+                    return;
+                }
+
                 const scoreCell = tablePlayers[currentPlayer].childNodes[2].childNodes[0];
                 sendCmds([{
                     cmd: "score",