Skip to content

Commit

Permalink
Merge pull request console-rs#65 from MichaelAquilina/fix/crash_divid…
Browse files Browse the repository at this point in the history
…e_by_zero
  • Loading branch information
pksunkara committed May 21, 2020
2 parents 79d47a6 + 8ecd09e commit 1202848
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/prompts/multi_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ impl<'a> MultiSelect<'a> {
self.items.len()
};

let pages = (self.items.len() / capacity) + 1;
let pages = if capacity == 0 {
return Ok(vec![]);
} else {
(self.items.len() / capacity) + 1
};

let mut render = TermThemeRenderer::new(term, self.theme);
let mut sel = 0;

Expand Down

0 comments on commit 1202848

Please sign in to comment.