diff options
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/widget/EditMessage.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java b/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java index bb276a182..ca61491a9 100644 --- a/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java +++ b/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java @@ -85,16 +85,20 @@ public class EditMessage extends EmojiWrapperEditText { } private void triggerKeyboardEvents(final int length) { + final KeyboardListener listener = this.keyboardListener; + if (listener == null) { + return; + } this.mTypingHandler.removeCallbacks(mTypingTimeout); this.mTypingHandler.postDelayed(mTypingTimeout, Config.TYPING_TIMEOUT * 1000); if (!isUserTyping && length > 0) { this.isUserTyping = true; - this.keyboardListener.onTypingStarted(); + listener.onTypingStarted(); } else if (length == 0) { this.isUserTyping = false; - this.keyboardListener.onTextDeleted(); + listener.onTextDeleted(); } - this.keyboardListener.onTextChanged(); + listener.onTextChanged(); } public void setKeyboardListener(KeyboardListener listener) { |