1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00

Fix crash on auto table layout for some corner cases

Fix #704.
This commit is contained in:
Guillaume Ayoub 2019-01-03 13:57:46 +01:00
parent 723fb4e20e
commit e49e20422a

View File

@ -470,7 +470,10 @@ def table_and_columns_preferred_widths(context, box, outer=True):
other_columns_contributions_sum = sum(
other_columns_contributions)
if other_columns_contributions_sum == 0:
ratio = 1 / len(other_columns_contributions)
if other_columns_contributions:
ratio = 1 / len(other_columns_contributions)
else:
ratio = 1
else:
ratio = (
max_content_widths[i] /