From d25341901c29c01d76f5f93cf656f54093513b03 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 3 Feb 2021 19:17:10 -0500 Subject: [PATCH] Skip backup if project folder isn't writeable Fixes https://gitlab.com/kicad/code/kicad/-/issues/7405 --- common/settings/settings_manager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index 279d5198c9..8fa4bd8513 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -1017,8 +1017,10 @@ bool SETTINGS_MANAGER::TriggerBackupIfNeeded( REPORTER& aReporter ) const return dt; }; - // Project not saved yet - if( Prj().GetProjectPath().empty() ) + wxFileName projectPath( Prj().GetProjectPath() ); + + // Skip backup if project path isn't valid or writeable + if( !projectPath.IsOk() || !projectPath.Exists() || !projectPath.IsDirWritable() ) return true; wxString backupPath = GetProjectBackupsPath();