safety first

This commit is contained in:
Stephan Dilly 2020-06-30 09:49:27 +02:00
parent 3ec47ced67
commit c784c9e9b3

View file

@ -253,7 +253,7 @@ impl DrawableComponent for FileTreeComponent {
let select = self
.tree
.selection
.map(|idx| idx - selection_offset)
.map(|idx| idx.saturating_sub(selection_offset))
.unwrap_or_default();
let tree_height = r.height.saturating_sub(2) as usize;