From 5ab9c94958d188cb8a626bacd739dc3da001f083 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 8 Jan 2022 17:56:29 +0100 Subject: [PATCH] fixing a crash at toggling caps lock, if keys have no label --- .../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 d0cfd92..703f37c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -460,7 +460,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut private fun adjustCase(label: CharSequence): CharSequence? { var newLabel: CharSequence? = label - if (mKeyboard!!.isShifted && newLabel != null && newLabel.length < 3 && Character.isLowerCase(newLabel[0])) { + if (newLabel != null && newLabel.isNotEmpty() && mKeyboard!!.isShifted && newLabel.length < 3 && Character.isLowerCase(newLabel[0])) { newLabel = newLabel.toString().toUpperCase() } return newLabel