Skip to content

Commit

Permalink
prevent crash when reading no utf8 files
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed Feb 12, 2024
1 parent c36e312 commit 674ebf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub fn read_plugin(path: &String) -> Plugin {
fn read_files_contents(files: &Vec<DirEntry>) -> Vec<PluginFile> {
let r = files
.into_iter()
.filter(|file| !file.file_name().into_string().unwrap().eq(".DS_Store"))
.filter(|file| !file.file_name().into_string().unwrap().eq(".DS_Store") && fs::read_to_string(file.path()).is_ok())
.map(|file| PluginFile {
content: fs::read_to_string(file.path()).unwrap(),
name: file.file_name().into_string().unwrap(),
Expand Down

0 comments on commit 674ebf6

Please sign in to comment.