Skip to content

Commit 82bac34

Browse files
authored
Merge pull request #158 from bfritscher/missing-keymaps-null-pointer
Fix a potential crash caused by a null pointer
2 parents 79ec797 + d4c5e4e commit 82bac34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Carnac.Logic/ShortcutProvider.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ public ShortcutProvider()
1515
{
1616
string folder = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"\Keymaps\";
1717
string filter = "*.yml";
18-
if (!Directory.Exists(folder)) return;
18+
if (!Directory.Exists(folder))
19+
{
20+
shortcuts = new List<ShortcutCollection>();
21+
return;
22+
}
1923
string[] files = Directory.GetFiles(folder, filter);
2024

2125
shortcuts = GetYamlMappings(files).Select(GetShortcuts).ToList();

0 commit comments

Comments
 (0)