fix crash when over-filtering

This commit is contained in:
rabite 2019-04-09 18:54:40 +02:00
parent 0eedd7da7f
commit ee3b82f85d
1 changed files with 5 additions and 0 deletions

View File

@ -440,6 +440,11 @@ impl ListView<Files>
self.content.set_filter(filter);
if self.content.len() == 0 {
self.show_status("No files like that! Resetting filter").log();
self.content.set_filter(Some("".to_string()));
}
if self.get_selection() > self.len() {
self.set_selection(self.len());
}