Fix crash on unexpected Side. ( The corners are not all interpreted as 0! )

This commit is contained in:
Tobias 2020-08-17 18:06:29 +02:00
parent 607bb18fb3
commit 06f8f96e98
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,9 @@ class TogglDelegate(ZeiDelegate):
def handleNotification(self, cHandle, data):
if cHandle == 38: # Side Change Notification
side = struct.unpack("B", data)[0]
self._trackProjectByMapping(self.mappings[side])
self._trackProjectByMapping(
self.mappings[side] if side in self.mappings else self.mappings[0]
)
else:
_log.info("Notification from hndl: %s - %r", cHandle, data)