mirror of https://github.com/bobwen-dev/hunter
fix crash when over-filtering
This commit is contained in:
parent
0eedd7da7f
commit
ee3b82f85d
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue