Skip to content

Commit

Permalink
fix panic for empty table in list
Browse files Browse the repository at this point in the history
  • Loading branch information
sftse committed Sep 12, 2024
1 parent c2e43c7 commit 3c6b04c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1801,13 +1801,9 @@ fn render_table_tree<T: Write, D: TextDecorator>(
.saturating_sub(1)
};

if table_width == 0 {
return Ok(TreeMapResult::Nothing);
}

renderer.start_block()?;

if renderer.options.draw_borders {
if table_width != 0 && renderer.options.draw_borders {
renderer.add_horizontal_border_width(table_width)?;
}

Expand Down

0 comments on commit 3c6b04c

Please sign in to comment.