From c2f2d16097a0e63f167bcb543963bb7523adfac1 Mon Sep 17 00:00:00 2001 From: lordwelch Date: Thu, 5 Mar 2020 14:46:17 -0800 Subject: [PATCH] Fix Nil map error --- ghid/keyboard.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ghid/keyboard.go b/ghid/keyboard.go index 7cd5537..096189f 100644 --- a/ghid/keyboard.go +++ b/ghid/keyboard.go @@ -273,6 +273,9 @@ func (k *Keyboard) CurrentKeymap() Keymap { if ok { return keymap } + if k.keymaps == nil { + k.keymaps = make(map[string]Keymap) + } k.keymaps[k.KeymapOrder[k.currentKeyMap]] = LoadKeymap(k.KeymapOrder[k.currentKeyMap], k.KeymapPath) return k.keymaps[k.KeymapOrder[k.currentKeyMap]] }