From f0e577b2bcd16c6c95ae417860a79a31448bd569 Mon Sep 17 00:00:00 2001 From: Pieterv24 <9167905+Pieterv24@users.noreply.github.com> Date: Tue, 27 Apr 2021 12:04:55 +0200 Subject: [PATCH] fix: Fixed bug that crashes matrix_text when encoders are present --- src/main/python/matrix_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/python/matrix_test.py b/src/main/python/matrix_test.py index 28ac550..3d22800 100644 --- a/src/main/python/matrix_test.py +++ b/src/main/python/matrix_test.py @@ -89,13 +89,14 @@ class MatrixTest(BasicEditor): # write matrix state to keyboard widget for w in self.keyboardWidget.widgets: - row = w.desc.row - col = w.desc.col + if w.desc.row is not None and w.desc.col is not None: + row = w.desc.row + col = w.desc.col - if row < len(matrix) and col < len(matrix[row]): - w.setPressed(matrix[row][col]) - if matrix[row][col]: - w.setActive(True) + if row < len(matrix) and col < len(matrix[row]): + w.setPressed(matrix[row][col]) + if matrix[row][col]: + w.setActive(True) self.keyboardWidget.update_layout() self.keyboardWidget.update()