more defensive

This commit is contained in:
Will McGugan 2023-07-29 10:09:09 +01:00
parent dbf66e8bb9
commit 1e1a7b4c48
1 changed files with 3 additions and 4 deletions

View File

@ -254,10 +254,9 @@ class TableElement(MarkdownElement):
) -> RenderResult:
table = Table(box=box.SIMPLE_HEAVY)
assert self.header is not None
assert self.header.row is not None
for column in self.header.row.cells:
table.add_column(column.content)
if self.header is not None and self.header.row is not None:
for column in self.header.row.cells:
table.add_column(column.content)
if self.body is not None:
for row in self.body.rows: