[PTRun]Fix access crash when saving settings version (#31104)

This commit is contained in:
Jaime Bernardo
2024-01-23 14:09:28 +00:00
committed by GitHub
parent 2fa4a489a1
commit 18608b21b8

View File

@@ -3,7 +3,9 @@
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.IO.Abstractions;
using Wox.Plugin.Logger;
namespace Wox.Infrastructure.Storage
{
@@ -122,9 +124,16 @@ namespace Wox.Infrastructure.Storage
}
public void Close()
{
try
{
// Update the Version file to the current version of powertoys
File.WriteAllText(FilePath, currentPowerToysVersion);
}
catch (System.Exception e)
{
Log.Exception($"Error in saving version at <{FilePath}>", e, GetType());
}
}
}
}