mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix possible exception when deleting local folder
This commit is contained in:
parent
f0e74a2aa5
commit
37837e7002
1 changed files with 17 additions and 2 deletions
|
|
@ -521,7 +521,15 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
FilesFolders.CopyAll(pluginFolderPath, newPluginPath, MessageBoxEx.Show);
|
||||
|
||||
Directory.Delete(tempFolderPluginPath, true);
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(tempFolderPluginPath))
|
||||
Directory.Delete(tempFolderPluginPath, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception($"|PluginManager.InstallPlugin|Failed to delete temp folder {tempFolderPluginPath}", e);
|
||||
}
|
||||
|
||||
if (checkModified)
|
||||
{
|
||||
|
|
@ -557,7 +565,14 @@ namespace Flow.Launcher.Core.Plugin
|
|||
if (pluginJsonStorage != null)
|
||||
{
|
||||
var deleteMethod = pluginJsonStorage.GetType().GetMethod("DeleteDirectory");
|
||||
deleteMethod?.Invoke(pluginJsonStorage, null);
|
||||
try
|
||||
{
|
||||
deleteMethod?.Invoke(pluginJsonStorage, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception($"|PluginManager.UninstallPlugin|Failed to delete plugin json folder for {assemblyName}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue