summaryrefslogtreecommitdiff
path: root/jfr_playoff/generator.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-12-28 00:26:04 +0100
committeremkael <emkael@tlen.pl>2019-12-28 00:26:04 +0100
commitea89502c25f80b2aebbf0d2c187711140d235274 (patch)
treea0b5c079c9708af6c3326cfc6125734e71981e67 /jfr_playoff/generator.py
parentbc728e4587ebe5b7ea1c21f7636b0ed1b786c64c (diff)
Avoiding division by zero for empty phase dimensions calculation
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r--jfr_playoff/generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index 062ccab..5411e0e 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -326,7 +326,8 @@ class PlayoffGenerator(object):
if self.page.get('starting_position_indicators', None) \
else col_no * (self.page['width'] + self.page['margin'])
grid_boxes += self.get_phase_header(phase, grid_x)
- match_height = canvas_size[1] / len(phase.matches)
+ match_height = canvas_size[1] / len(phase.matches) \
+ if len(phase.matches) > 0 else 0
row_no = 0
for match in phase.matches:
grid_y = self.page['margin'] / 2 if dimensions[1] == 1 else \