Fix a client crash when the server was not sending it correct multi-PVs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 16 Nov 2016 19:03:28 +0000 (20:03 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Nov 2016 22:12:02 +0000 (23:12 +0100)
www/js/remoteglot.js

index 1f4c2a5..3568360 100644 (file)
@@ -1208,7 +1208,9 @@ var update_board = function() {
                for (var i = 1; i < alt_moves.length && i < 3; ++i) {
                        hiddenboard = new Chess(base_fen);
                        var move = hiddenboard.move(alt_moves[i]);
-                       create_arrow(move.from, move.to, '#f66', 1, 10);
+                       if (move !== null) {
+                               create_arrow(move.from, move.to, '#f66', 1, 10);
+                       }
                }
        }