From 0bdf0474c985be6a3f4defe3642467a04aa1f918 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Fri, 14 Feb 2025 16:05:49 +1300 Subject: [PATCH] Small error message fix --- rog-control-center/src/tray.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rog-control-center/src/tray.rs b/rog-control-center/src/tray.rs index 0e4e6ab3..f5437498 100644 --- a/rog-control-center/src/tray.rs +++ b/rog-control-center/src/tray.rs @@ -32,7 +32,10 @@ static ICONS: OnceLock = OnceLock::new(); fn read_icon(file: &Path) -> Icon { let mut path = PathBuf::from(TRAY_ICON_PATH); path.push(file); - let mut file = OpenOptions::new().read(true).open(path).unwrap(); + let mut file = OpenOptions::new() + .read(true) + .open(&path) + .unwrap_or_else(|_| panic!("Missing icon: {:?}", path)); let mut bytes = Vec::new(); file.read_to_end(&mut bytes).unwrap();