Fix ISE crash in compose text watcher.

This commit is contained in:
Cody Henthorne 2023-10-04 16:16:11 -04:00 committed by Nicholas Tinsley
parent 6232656ad4
commit fd07ab10ee

View file

@ -3729,7 +3729,11 @@ class ConversationFragment :
override fun afterTextChanged(s: Editable) {
calculateCharactersRemaining()
if (composeText.textTrimmed.isEmpty() || beforeLength == 0) {
composeText.postDelayed({ updateToggleButtonState() }, 50)
composeText.postDelayed({
if (lifecycle.currentState.isAtLeast(Lifecycle.State.CREATED)) {
updateToggleButtonState()
}
}, 50)
}
if (!inputPanel.inEditMessageMode()) {