]> git.sesse.net Git - remoteglot/commitdiff
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 f4bf795c240262824733631a4bbfe50c89e0d210..a991a0242388fc3bee32b2f9143143869dff825a 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];