mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix null handling to prevent NullReferenceException
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
6d2be7a3a1
commit
d8a4bbc73a
1 changed files with 2 additions and 1 deletions
|
|
@ -380,8 +380,9 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsValidFileName(string name)
|
public static bool IsValidFileName(string name)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(name)) return false;
|
||||||
if (IsReservedName(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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue