mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add default win32, so we should not contain null
This commit is contained in:
parent
033ce3051b
commit
f14a5b9229
1 changed files with 16 additions and 3 deletions
|
|
@ -35,6 +35,20 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
private const string ShortcutExtension = "lnk";
|
||||
private const string ExeExtension = "exe";
|
||||
|
||||
private static readonly Win32 Default = new Win32()
|
||||
{
|
||||
Name = string.Empty,
|
||||
Description = string.Empty,
|
||||
IcoPath = string.Empty,
|
||||
FullPath = string.Empty,
|
||||
LnkResolvedPath = null,
|
||||
ParentDirectory = string.Empty,
|
||||
ExecutableName = null,
|
||||
UniqueIdentifier = string.Empty,
|
||||
Valid = false,
|
||||
Enabled = false
|
||||
};
|
||||
|
||||
|
||||
public Result Result(string query, IPublicAPI api)
|
||||
{
|
||||
|
|
@ -423,12 +437,12 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
private static Win32 GetProgramFromPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return null;
|
||||
return Default;
|
||||
|
||||
path = Environment.ExpandEnvironmentVariables(path);
|
||||
|
||||
if (!File.Exists(path))
|
||||
return null;
|
||||
return Default;
|
||||
|
||||
var entry = Win32Program(path);
|
||||
|
||||
|
|
@ -504,7 +518,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
programs = programs.Concat(startMenu);
|
||||
}
|
||||
|
||||
|
||||
return ProgramsHasher(programs.Where(p => p != null));
|
||||
}
|
||||
#if DEBUG //This is to make developer aware of any unhandled exception and add in handling.
|
||||
|
|
|
|||
Loading…
Reference in a new issue