Skip to content

Commit d832ef4

Browse files
committed
[FIX] server: do not crash if file is not in cache anymore
If a file is closed while some rebuild is waiting, the rebuild should not crash but skip closed files
1 parent c8191c7 commit d832ef4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/core/python_arch_eval.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ impl PythonArchEval {
7878
panic!("Trying to eval_arch a symbol without any path")
7979
}
8080
let path = self.file.borrow().get_symbol_first_path();
81-
let file_info_rc = session.sync_odoo.get_file_mgr().borrow().get_file_info(&path).expect("File not found in cache").clone();
81+
let Some(file_info_rc) = session.sync_odoo.get_file_mgr().borrow().get_file_info(&path).clone() else {
82+
warn!("File info not found for {}", path);
83+
return;
84+
};
8285
if file_info_rc.borrow().file_info_ast.borrow().ast.is_none() {
8386
file_info_rc.borrow_mut().prepare_ast(session);
8487
}

0 commit comments

Comments
 (0)