From 443b5f37abfb3e60b99f76b8c50b28de5f7d8dab Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 11 Nov 2024 17:44:16 +0100 Subject: [PATCH] fix(config): crash if unable to watch config folder --- zellij-client/src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs index fad3c88bf..8738650e7 100644 --- a/zellij-client/src/lib.rs +++ b/zellij-client/src/lib.rs @@ -707,10 +707,13 @@ fn report_changes_in_config_file( }) .unwrap(); if let Some(config_file_parent_folder) = config_file_path.parent() { - watcher - .watch(&config_file_parent_folder, RecursiveMode::Recursive) - .unwrap(); - Some(Box::new(watcher)) + match watcher.watch(&config_file_parent_folder, RecursiveMode::Recursive) { + Ok(_) => Some(Box::new(watcher)), + Err(e) => { + log::error!("Failed to watch config file folder: {}", e); + None + }, + } } else { log::error!("Could not find config parent folder"); None