Add a last-ditch resort for format_long_score(), if anything goes wrong.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 21:29:35 +0000 (22:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 21:29:35 +0000 (22:29 +0100)
www/js/remoteglot.js

index f4bf795..a991a02 100644 (file)
@@ -2003,6 +2003,9 @@ var format_short_score = function(score) {
 }
 
 var format_long_score = function(score) {
+       if (!score) {
+               return "???";
+       }
        if (score[0] === 'm') {
                if (score[1] > 0) {
                        return "White mates in " + score[1];