From e69a48aa0f89558cf3c9a5acf2a29db2bbb65106 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 21 Jan 2022 18:56:19 +0100 Subject: [PATCH] do not crash on pressing the empty space near A or L --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 25acdabe..fdfbefa2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1224,7 +1224,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) } - if (mKeys[mCurrentKey].codes.firstOrNull() == MyKeyboard.KEYCODE_SPACE && !mIsLongPressingSpace) { + if (mKeys.getOrNull(mCurrentKey)?.codes?.firstOrNull() == MyKeyboard.KEYCODE_SPACE && !mIsLongPressingSpace) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) }