diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 72d4ef692..76a53da46 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -440,7 +440,8 @@ fn save_as(s: &mut Session, cmd: &str, path: &str, opts: &SaveAs) -> Result Result<()> { #[cfg(not(target_arch = "wasm32"))] { - if is_drawing_file(path) && crate::autosave::isavebak() { + // A file in a folder still to be made has nothing to back up. + if is_drawing_file(path) && crate::autosave::isavebak() && crate::atomic_write::missing_folder(std::path::Path::new(path)).is_none() { backup(std::path::Path::new(path)) .map_err(|e| bad("save", format!("{path}: the backup copy could not be written ({e}); nothing was saved")))?; }