Skip backup if project folder isn't writeable

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7405
This commit is contained in:
Jon Evans 2021-02-03 19:17:10 -05:00
parent 3ac5fd6342
commit d25341901c
1 changed files with 4 additions and 2 deletions

View File

@ -1017,8 +1017,10 @@ bool SETTINGS_MANAGER::TriggerBackupIfNeeded( REPORTER& aReporter ) const
return dt; return dt;
}; };
// Project not saved yet wxFileName projectPath( Prj().GetProjectPath() );
if( Prj().GetProjectPath().empty() )
// Skip backup if project path isn't valid or writeable
if( !projectPath.IsOk() || !projectPath.Exists() || !projectPath.IsDirWritable() )
return true; return true;
wxString backupPath = GetProjectBackupsPath(); wxString backupPath = GetProjectBackupsPath();