Skip to content

Commit

Permalink
fix(presentation): Prevent a crash when the presentation file is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
zedseven committed Apr 13, 2024
1 parent 6e28cd0 commit 38e32c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/presentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ impl Presentation {
slides.push(Slide::Text(current_paragraph));
}

// Ensure the presentation always has at least one slide
if slides.is_empty() {
slides.push(Slide::Empty);
}

// Construct the final result
Self {
font_list,
foreground_colour,
Expand Down

0 comments on commit 38e32c3

Please sign in to comment.