Skip to content

Commit

Permalink
fix: Fix error when rendering empty multi header files (#268)
Browse files Browse the repository at this point in the history
This PR fixes #253 by defaulting a columns width to 0 when there is no
data to show.
  • Loading branch information
fxwiegand committed Nov 17, 2022
1 parent 3810768 commit 9c2b464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/portable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ fn get_column_width(
.map(|row| row.get(column_index).unwrap().to_string())
.map(|s| s.len())
.max()
.unwrap();
.unwrap_or(0);

Ok(width as i32)
}
Expand Down

0 comments on commit 9c2b464

Please sign in to comment.