diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs index eb3fb8c602..b9318a6e4b 100644 --- a/cli/util/file_watcher.rs +++ b/cli/util/file_watcher.rs @@ -185,9 +185,11 @@ impl WatcherCommunicator { pub fn show_path_changed(&self, changed_paths: Option>) { if let Some(paths) = changed_paths { - self.print( - format!("Restarting! File change detected: {:?}", paths[0]).to_string(), - ) + if !paths.is_empty() { + self.print(format!("Restarting! File change detected: {:?}", paths[0])) + } else { + self.print("Restarting! File change detected.".to_string()) + } } } }