Skip to content

Commit c62cdd5

Browse files
if-canBambooin
authored andcommitted
fix: currentKeyboardView has not been initialized, causing crash
1 parent ebfda6e commit c62cdd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/main/java/com/osfans/trime/ime/core/TrimeInputMethodService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
237237
commitText(commit.text)
238238
}
239239
updateComposingText(ctx)
240-
KeyboardSwitcher.currentKeyboardView.invalidateAllKeys()
240+
KeyboardSwitcher.currentKeyboardView?.invalidateAllKeys()
241241
}
242242
is RimeMessage.KeyMessage ->
243243
it.data.let event@{

app/src/main/java/com/osfans/trime/ime/keyboard/KeyboardSwitcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ package com.osfans.trime.ime.keyboard
88
@Deprecated("Migrate into KeyboardWindow")
99
object KeyboardSwitcher {
1010
lateinit var currentKeyboard: Keyboard
11-
lateinit var currentKeyboardView: KeyboardView
11+
var currentKeyboardView: KeyboardView? = null
1212
}

0 commit comments

Comments
 (0)