fix for crash when using keypad to turn shaders on (no previous state stored invalid key)

This commit is contained in:
Tristan Rowley
2020-01-31 18:56:41 +00:00
parent 3faa041fc5
commit af27ea633d

View File

@@ -225,7 +225,7 @@ class MidiFeedbackAPCKey25Plugin(MidiFeedbackPlugin):
#print("in update device status is %s" % self.status)
for i,c in self.status.items():
#'print("comparing\n%s to\n%s" % (c, self.last_state[i]))
if self.last_state is None or self.last_state[i]!=c:
if self.last_state is None or (i not in self.last_state or self.last_state[i]!=c):
#print("got command: %s: %s" % (i,c))
self.send_command(**c)
self.last_state = deepcopy(self.status)