Fix a crash on short multi-PVs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 13 Aug 2019 20:07:45 +0000 (22:07 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 13 Aug 2019 20:07:45 +0000 (22:07 +0200)
www/js/remoteglot.js

index 1e89929..01faf1a 100644 (file)
@@ -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;