From d7deda9e4669f63832193036774b5c3254088840 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 26 Jul 2019 12:49:48 +0200 Subject: Fallbacks for empty input data --- jfr_playoff/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jfr_playoff') diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py index 95017a2..641a329 100644 --- a/jfr_playoff/data.py +++ b/jfr_playoff/data.py @@ -89,7 +89,7 @@ class PlayoffData(object): def prefill_leaderboard(self, teams): self.leaderboard = [None] * len(teams) for team in teams: - if len(team) > 3: + if len(team) > 3 and team[3] is not None: self.leaderboard[team[3]-1] = team[0] self.fill_swiss_leaderboard(self.swiss, teams) PlayoffLogger.get('data').info('leaderboard pre-filled: %s', self.leaderboard) @@ -167,7 +167,7 @@ class PlayoffData(object): max([ len(phase['matches']) + len(phase.get('dummies', [])) for phase in self.phases - ]) + ] or [0]) ) PlayoffLogger.get('data').info('grid dimensions: %s', dimensions) return dimensions -- cgit v1.2.3