From d8a4bbc73a059a3fd3558096d74ead7c85fdc979 Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Thu, 16 Oct 2025 20:40:36 +0800 Subject: [PATCH] Fix null handling to prevent NullReferenceException Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index dfa9b1eb6..ae15441fe 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -380,8 +380,9 @@ namespace Flow.Launcher.Plugin.SharedCommands /// public static bool IsValidFileName(string name) { + if (string.IsNullOrWhiteSpace(name)) return false; if (IsReservedName(name)) return false; - if (name.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || string.IsNullOrWhiteSpace(name)) + if (name.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) { return false; }