From 205d8110d05a694940338d0df6f956202e04aa36 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 6 Jun 2020 22:41:10 +0200 Subject: [PATCH] Fix broken actions after config format change Signed-off-by: Knut Ahlers --- cmd/streamdeck/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/streamdeck/main.go b/cmd/streamdeck/main.go index 5cbc886..19f3a1a 100644 --- a/cmd/streamdeck/main.go +++ b/cmd/streamdeck/main.go @@ -167,11 +167,11 @@ func main() { offTimer.Reset(userConfig.DisplayOffTime) } - if evt.Key >= len(activePage.Keys) { + kd, ok := activePage.Keys[evt.Key] + if !ok { continue } - kd := activePage.Keys[evt.Key] if kd.On == "down" && evt.Type == streamdeck.EventTypeDown || (kd.On == "up" || kd.On == "") && evt.Type == streamdeck.EventTypeUp || kd.On == "both" { if err := triggerAction(kd); err != nil { log.WithError(err).Error("Unable to execute action")