20 fixes: mutex poisoning recovery, clickthrough shutdown, audio cleanup, config corruption, GIF aspect ratio, ffmpeg crash detection, cancel export, discard confirm, thumbnail cache, keyboard nav, right-click tracking, multi-monitor overlay, click injection fix, update script robustness, effect cleanup, concat guard, dead code removal
This commit is contained in:
+12
-1
@@ -136,7 +136,18 @@ impl Config {
|
||||
return Ok(cfg);
|
||||
}
|
||||
let raw = std::fs::read_to_string(path)?;
|
||||
Ok(toml::from_str(&raw)?)
|
||||
match toml::from_str::<Self>(&raw) {
|
||||
Ok(cfg) => Ok(cfg),
|
||||
Err(e) => {
|
||||
// Config is corrupt - back it up and return defaults
|
||||
tracing::warn!("config.toml is corrupt ({e}), backing up and using defaults");
|
||||
let backup = path.with_extension("toml.bak");
|
||||
let _ = std::fs::copy(path, &backup);
|
||||
let cfg = Self::default();
|
||||
cfg.save(path)?;
|
||||
Ok(cfg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save(&self, path: &Path) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user