Skip to content

Commit d40ff12

Browse files
authored
Merge pull request #1854 from Flow-Launcher/taooceros-patch-1
Fix Error of loading backup when original file doesn't exists
2 parents 8090109 + 4e1d59b commit d40ff12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Flow.Launcher.Infrastructure/Storage/JsonStorage.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ private T LoadDefault()
7777
if (data != null)
7878
{
7979
Log.Info($"|JsonStorage.Load|Failed to load settings.json, {BackupFilePath} restored successfully");
80-
File.Replace(BackupFilePath, FilePath, null);
80+
81+
if(File.Exists(FilePath))
82+
File.Replace(BackupFilePath, FilePath, null);
83+
else
84+
File.Move(BackupFilePath, FilePath);
8185

8286
return data;
8387
}

0 commit comments

Comments
 (0)