@@ -15,7 +15,7 @@ namespace Flow.Launcher.Plugin.Program.Views.Models
15
15
/// </remarks>
16
16
public class ProgramSource
17
17
{
18
- private string name ;
18
+ private string name = string . Empty ;
19
19
private string loc = string . Empty ;
20
20
private string uniqueIdentifier = string . Empty ;
21
21
@@ -29,7 +29,7 @@ public string Location
29
29
}
30
30
}
31
31
32
- public string Name { get => name ?? new DirectoryInfo ( Location ) . Name ; set => name = value ; }
32
+ public string Name { get => name ; set => name = value ?? string . Empty ; }
33
33
public bool Enabled { get ; set ; } = true ;
34
34
35
35
public string UniqueIdentifier { get => uniqueIdentifier ;
@@ -43,7 +43,7 @@ private set
43
43
public ProgramSource ( string name , string location , bool enabled , string uniqueIdentifier )
44
44
{
45
45
loc = location ?? string . Empty ;
46
- this . name = name ;
46
+ Name = name ;
47
47
Enabled = enabled ;
48
48
UniqueIdentifier = uniqueIdentifier ;
49
49
}
@@ -58,11 +58,12 @@ public ProgramSource(string location, bool enabled = true)
58
58
loc = location ?? string . Empty ;
59
59
Enabled = enabled ;
60
60
UniqueIdentifier = location ; // For path comparison
61
+ Name = new DirectoryInfo ( Location ) . Name ;
61
62
}
62
63
63
64
public ProgramSource ( IProgram source )
64
65
{
65
- loc = source . Location ;
66
+ loc = source . Location ?? string . Empty ;
66
67
Name = source . Name ;
67
68
Enabled = source . Enabled ;
68
69
UniqueIdentifier = source . UniqueIdentifier ;
0 commit comments