Skip to content

Commit 9cc8a56

Browse files
committed
Prevent crash on empty <table> tags; fixes Sub6Resources#893
1 parent cd1e510 commit 9cc8a56

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/layout_element.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ class TableLayoutElement extends LayoutElement {
155155
max(0, columnMax - finalColumnSizes.length),
156156
(_) => IntrinsicContentTrackSize());
157157

158+
if (finalColumnSizes.isEmpty || rowSizes.isEmpty) {
159+
// No actual cells to show
160+
return SizedBox();
161+
}
162+
158163
return LayoutGrid(
159164
gridFit: GridFit.loose,
160165
columnSizes: finalColumnSizes,

0 commit comments

Comments
 (0)