mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 08:47:14 +00:00
Trycatch backup file creation
Stop putting PKHeX in Program Files ya goofballs
This commit is contained in:
parent
6a96ad2278
commit
51f2fe35a4
1 changed files with 11 additions and 1 deletions
|
@ -824,8 +824,18 @@ namespace PKHeX.WinForms
|
|||
{
|
||||
var src = sav.Metadata.FilePath;
|
||||
if (src is { } x && File.Exists(x))
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Copy(x, backupName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WinFormsUtil.Error(MsgBackupUnable, ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!FileUtil.IsFileLocked(path))
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue