]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Add a temporary safeguard.
[remoteglot] / www / js / remoteglot.js
index cff91cee612020e1a4aac339973104fa7323105f..21a995eea87a4073c7a92062ab8964e069baf340 100644 (file)
@@ -1866,7 +1866,7 @@ var onSnapEnd = function(source, target) {
 
        if (current_display_line &&
            current_display_move < current_display_line.pretty_pv.length - 1 &&
-           current_display_line.pretty_pv[current_display_move] === move.san) {
+           current_display_line.pretty_pv[current_display_move + 1] === move.san) {
                next_move();
                return;
        }
@@ -1907,6 +1907,9 @@ var fmt_cp = function(v) {
 }
 
 var format_short_score = function(score) {
+       if (!score) {
+               return "???";
+       }
        if (score[0] === 'm') {
                if (score[2]) {  // Is a bound.
                        return score[2] + "\u00a0M" + pad(score[1], 3);