From 04bd9ddc2c1dbd96e65dc99dbfe4edc1173551be Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Tue, 12 Aug 2025 18:09:59 +0800 Subject: [PATCH] Verify File.Delete exception handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Flow.Launcher.Core/Plugin/PluginManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index d13e4c3b0..37b2660dc 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -183,7 +183,14 @@ namespace Flow.Launcher.Core.Plugin const string binding = "flowlauncher.py"; foreach (var subDirectory in Directory.GetDirectories(DataLocation.PluginsDirectory)) { - File.Delete(Path.Combine(subDirectory, binding)); + try + { + File.Delete(Path.Combine(subDirectory, binding)); + } + catch (Exception e) + { + API.LogDebug(ClassName, $"Failed to delete {binding} in {subDirectory}: {e.Message}"); + } } }