]> git.sesse.net Git - ultimatescore/commitdiff
Some bugfixes in the carousel with unplayed matches.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Oct 2017 18:22:59 +0000 (20:22 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Oct 2017 18:22:59 +0000 (20:22 +0200)
carousel.js

index 28c27e2de6b5cf8310286d4885f62a4982c1f33a..3d8d20f03220005760af088b40819a138df13981 100644 (file)
@@ -187,7 +187,8 @@ rank = function(games, teams, start_rank, tiebreakers) {
        for (i = 0; i < games.length; ++i) {
                var idx1 = teams_to_idx[games[i].name1];
                var idx2 = teams_to_idx[games[i].name2];
-               if (idx1 !== undefined && idx2 !== undefined) {
+               if (idx1 !== undefined && idx2 !== undefined &&
+                   !isNaN(games[i].score1) && isNaN(games[i].score2)) {
                        teams[idx1].h2h_gd += games[i].score1;
                        teams[idx1].h2h_gd -= games[i].score2;
                        teams[idx2].h2h_gd += games[i].score2;
@@ -292,6 +293,7 @@ var display_group_parsed = function(teams, games, group_name)
                var idx1 = teams_to_idx[games[i].name1];
                var idx2 = teams_to_idx[games[i].name2];
                if (games[i].score1 === undefined || games[i].score2 === undefined ||
+                   isNaN(games[i].score1) || isNaN(games[i].score2) ||
                    idx1 === undefined || idx2 === undefined ||
                    games[i].score1 == games[i].score2) {
                        continue;