Skip to content

Commit

Permalink
Fix possible panic in ListView
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Oct 15, 2017
1 parent 420454c commit e7ee525
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ impl ListView {

// Now that we have a relative position, checks for buttons?
let focus = position.y + self.scrollbase.start_line;
if focus >= self.children.len() {
return;
}

if let ListChild::Row(_, ref mut view) = self.children[focus] {
if view.take_focus(direction::Direction::none()) {
self.focus = focus;
Expand Down

0 comments on commit e7ee525

Please sign in to comment.