Skip to content

Commit

Permalink
more defensive
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jul 29, 2023
1 parent dbf66e8 commit 1e1a7b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rich/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,9 @@ def __rich_console__(
) -> 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:
Expand Down

0 comments on commit 1e1a7b4

Please sign in to comment.