Skip to content

Commit

Permalink
Merge pull request #158 from bfritscher/missing-keymaps-null-pointer
Browse files Browse the repository at this point in the history
Fix a potential crash caused by a null pointer
  • Loading branch information
hnrkndrssn authored Jul 12, 2017
2 parents 79ec797 + d4c5e4e commit 82bac34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Carnac.Logic/ShortcutProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ public ShortcutProvider()
{
string folder = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"\Keymaps\";
string filter = "*.yml";
if (!Directory.Exists(folder)) return;
if (!Directory.Exists(folder))
{
shortcuts = new List<ShortcutCollection>();
return;
}
string[] files = Directory.GetFiles(folder, filter);

shortcuts = GetYamlMappings(files).Select(GetShortcuts).ToList();
Expand Down

0 comments on commit 82bac34

Please sign in to comment.