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 76b4125..5e969c2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1154,8 +1154,8 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut // fix a glitch with long pressing backspace, then clicking some letter if (mRepeatKeyIndex != NOT_A_KEY) { - val key = mKeys[mRepeatKeyIndex] - if (key.code == KEYCODE_DELETE) { + val key = mKeys.getOrNull(mRepeatKeyIndex) + if (key?.code == KEYCODE_DELETE) { mHandler?.removeMessages(MSG_REPEAT) mRepeatKeyIndex = NOT_A_KEY }