diff --git a/crates/project_panel/src/file_associations.rs b/crates/project_panel/src/file_associations.rs index ea8e59685b8d10c744c35f8d585bade74268a499..e1fb9b3c64fca52fe1f37bed9dd7b5488c5ea2cc 100644 --- a/crates/project_panel/src/file_associations.rs +++ b/crates/project_panel/src/file_associations.rs @@ -26,8 +26,15 @@ pub fn init(assets: impl AssetSource, cx: &mut AppContext) { impl FileAssociations { pub fn new(assets: impl AssetSource) -> Self { - let file = assets.load("icons/file_icons/file_types.json").unwrap(); - serde_json::from_str::(str::from_utf8(&file).unwrap()).unwrap() + assets + .load("icons/file_icons/file_types.json") + .map(|file| { + serde_json::from_str::(str::from_utf8(&file).unwrap()).unwrap() + }) + .unwrap_or_else(|_| FileAssociations { + suffixes: HashMap::default(), + types: HashMap::default(), + }) } pub fn get_icon(path: &Path, cx: &AppContext) -> Option> {