From 0248dd6809f5fd679719a2cf9b05c06aeeb4da21 Mon Sep 17 00:00:00 2001 From: Victor Fuentes Date: Mon, 12 Sep 2022 18:09:47 -0400 Subject: [PATCH] Add detection of invalid configs --- src/ui/window.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ui/window.rs b/src/ui/window.rs index 0b41e6a..f8f293f 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -378,7 +378,19 @@ impl Component for AppModel { let (config, welcome) = if let Some(config) = getconfig() { debug!("Got config: {:?}", config); - (config, false) + if !Path::new(&config.systemconfig).exists() { + warn!("Invalid system config path: {}", config.systemconfig); + (config, true) + } else if let Some(flakepath) = &config.flake { + if !Path::new(&flakepath).exists() { + warn!("Invalid flake path: {}", flakepath); + (config, true) + } else { + (config, false) + } + } else { + (config, false) + } } else { // Show welcome page debug!("No config found");