]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Fix a crash on short multi-PVs.
[remoteglot] / www / js / remoteglot.js
index d89da33b3d5339f5b581c356ba2fb68af78f3389..01faf1aec858f3b603f14ee3ad04828e40f53a6f 100644 (file)
@@ -796,7 +796,7 @@ var update_refutation_lines = function() {
        }
 
        var invert = (toplay === 'B');
-       if (current_display_line && current_display_move % 2 == 0) {
+       if (current_display_line && current_display_move % 2 == 0 && !current_display_line_is_history) {
                invert = !invert;
        }
        moves = moves.sort(function(a, b) { return compare_by_score(refutation_lines, invert, a, b) });
@@ -1260,7 +1260,7 @@ var update_board = function() {
                        if (!data['refutation_lines'] ||
                            !data['refutation_lines'][nonstupid_moves[i]] ||
                            !data['refutation_lines'][nonstupid_moves[i]]['pv'] ||
-                           data['refutation_lines'][nonstupid_moves[i]]['pv'].length < 1) {
+                           data['refutation_lines'][nonstupid_moves[i]]['pv'].length < 2) {
                                // Incomplete PV, abort.
                                response = undefined;
                                break;