mirror of https://github.com/Textualize/rich.git
more defensive
This commit is contained in:
parent
dbf66e8bb9
commit
1e1a7b4c48
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue