Skip to content

Commit

Permalink
fix vfs panic when file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Oct 27, 2023
1 parent ceba6e0 commit 94670b2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compiler/src/vfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,15 @@ impl<M: AccessModel + Sized> Vfs<M> {
f: &mut dyn FnMut(&'a ImmutPath, instant::SystemTime),
) {
for slot in self.slots.iter() {
let dep_path = slot.sampled_path.get().unwrap();
let dep_mtime = slot
let Some(dep_path) = slot.sampled_path.get() else {
continue;
};
let Ok(dep_mtime) = slot
.mtime
.compute(|| Err(other_reason("vfs: uninitialized")))
.unwrap();
else {
continue;
};

f(dep_path, *dep_mtime)
}
Expand Down

0 comments on commit 94670b2

Please sign in to comment.