mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Merge pull request #2207 from nextcloud/bugfix/2203/fixNpeEmojiClickListenerBinding
fix NPE for binding in onEmojiClickListener
This commit is contained in:
commit
ff0409ada4
@ -1679,6 +1679,7 @@ class ChatController(args: Bundle) :
|
||||
currentConversation?.sessionId != "0"
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
override fun onAttach(view: View) {
|
||||
super.onAttach(view)
|
||||
Log.d(
|
||||
@ -1718,7 +1719,13 @@ class ChatController(args: Bundle) :
|
||||
)
|
||||
},
|
||||
onEmojiClickListener = {
|
||||
try {
|
||||
binding.messageInputView.inputEditText?.editableText?.append(" ")
|
||||
} catch (npe: NullPointerException) {
|
||||
// view binding can be null
|
||||
// since this is called asynchronously and UI might have been destroyed in the meantime
|
||||
Log.i(WebViewLoginController.TAG, "UI destroyed - view binding already gone")
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user