Skip to content

Commit 58e5e5d

Browse files
committed
Fix division by zero (test http://www.tagesschau.de)
1 parent a4074dd commit 58e5e5d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/table.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,14 @@ void litehtml::table_grid::calc_rows_height(int blockHeight, int borderSpacingY)
514514
}
515515
else
516516
{
517-
// We don't have rows with height=auto, so ditribute height to all rows
518-
int extra_row_height = (int)(extra_height / m_rows.size());
519-
for (auto& row : m_rows)
517+
// We don't have rows with height=auto, so distribute height to all rows
518+
if (!m_rows.empty())
520519
{
521-
row.height += extra_row_height;
520+
int extra_row_height = (int)(extra_height / m_rows.size());
521+
for (auto& row : m_rows)
522+
{
523+
row.height += extra_row_height;
524+
}
522525
}
523526
}
524527
}

0 commit comments

Comments
 (0)