ensure we don't crash on deleted files
This commit is contained in:
parent
1b3ad0db65
commit
6282e2b22e
1 changed files with 3 additions and 3 deletions
|
|
@ -433,9 +433,9 @@ fn read_all_files_sync(changed_content: Vec<ChangedContent>) -> Vec<Vec<u8>> {
|
|||
|
||||
changed_content
|
||||
.into_iter()
|
||||
.map(|c| match (c.file, c.content) {
|
||||
(Some(file), None) => std::fs::read(file).unwrap(),
|
||||
(None, Some(content)) => content.into_bytes(),
|
||||
.filter_map(|c| match (c.file, c.content) {
|
||||
(Some(file), None) => std::fs::read(file).ok(),
|
||||
(None, Some(content)) => Some(content.into_bytes()),
|
||||
_ => Default::default(),
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue