summaryrefslogtreecommitdiffstats
path: root/src/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/history.rs')
-rw-r--r--src/history.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/history.rs b/src/history.rs
index 60d9641..fb425d4 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -90,7 +90,9 @@ impl DirectoryHistory for JoshutoHistory {
match self.entry(path.to_path_buf()) {
Entry::Occupied(mut entry) => {
let dirlist = entry.get_mut();
- dirlist.reload_contents(sort_option)?;
+ if let Err(_) = dirlist.reload_contents(sort_option) {
+ entry.remove_entry();
+ }
}
Entry::Vacant(entry) => {
let dirlist = JoshutoDirList::new(path.to_path_buf(), sort_option)?;
@@ -103,7 +105,9 @@ impl DirectoryHistory for JoshutoHistory {
fn reload(&mut self, path: &Path, sort_option: &sort::SortOption) -> std::io::Result<()> {
if let Entry::Occupied(mut entry) = self.entry(path.to_path_buf()) {
let dirlist = entry.get_mut();
- dirlist.reload_contents(sort_option)?;
+ if let Err(_) = dirlist.reload_contents(sort_option) {
+ entry.remove_entry();
+ }
}
Ok(())
}