]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Fix a crash bug when looking at old moves with no analysis.
[remoteglot] / www / js / remoteglot.js
index 01faf1aec858f3b603f14ee3ad04828e40f53a6f..bed5a5cdf8ad3d1fdd4de3eb9cff1f8b39d17b4b 100644 (file)
@@ -7,7 +7,7 @@
  * @type {Number}
  * @const
  * @private */
-var SCRIPT_VERSION = 2016113007;
+var SCRIPT_VERSION = 2016113008;
 
 /**
  * The current backend URL.
@@ -294,7 +294,7 @@ var request_update = function() {
                        update_num_viewers(num_viewers);
                } else {
                        console.log("Received invalid update, waiting five seconds and trying again.");
-                       location.reload(true);
+                       setTimeout(function() { location.reload(true); }, 5000);
                }
 
                // Next update.
@@ -780,6 +780,10 @@ var update_refutation_lines = function() {
        var tbl = $("#refutationlines");
        tbl.empty();
 
+       if (display_lines.length < 2) {
+               return;
+       }
+
        // Find out where the lines start from.
        var base_line = [];
        var base_scores = display_lines[1].scores;