Don't abort on failure to backup file if it was never saved.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17810
This commit is contained in:
Jeff Young 2024-05-05 14:57:07 +01:00
parent 39d9aba576
commit 0e0432d194
1 changed files with 2 additions and 1 deletions

View File

@ -1673,7 +1673,8 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
}
// Attempt to back up the last schematic file before overwriting it with the auto
// save file.
else if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
else if( recoveredFn.Exists()
&& !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
}