mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-19 05:30:15 +00:00
add destruction check before accessing the binding object
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1ebc2bac24
commit
266a9f73ee
@ -773,24 +773,26 @@ class ChatController(args: Bundle) :
|
||||
}
|
||||
|
||||
private fun setupMentionAutocomplete() {
|
||||
val elevation = 6f
|
||||
resources?.let {
|
||||
val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default))
|
||||
val presenter = MentionAutocompletePresenter(activity, roomToken)
|
||||
val callback = MentionAutocompleteCallback(
|
||||
activity,
|
||||
conversationUser,
|
||||
binding?.messageInputView?.inputEditText
|
||||
)
|
||||
if (!isDestroyed && !isBeingDestroyed) {
|
||||
val elevation = 6f
|
||||
resources?.let {
|
||||
val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default))
|
||||
val presenter = MentionAutocompletePresenter(activity, roomToken)
|
||||
val callback = MentionAutocompleteCallback(
|
||||
activity,
|
||||
conversationUser,
|
||||
binding?.messageInputView?.inputEditText
|
||||
)
|
||||
|
||||
if (mentionAutocomplete == null && binding?.messageInputView?.inputEditText != null) {
|
||||
mentionAutocomplete = Autocomplete.on<Mention>(binding?.messageInputView?.inputEditText)
|
||||
.with(elevation)
|
||||
.with(backgroundDrawable)
|
||||
.with(MagicCharPolicy('@'))
|
||||
.with(presenter)
|
||||
.with(callback)
|
||||
.build()
|
||||
if (mentionAutocomplete == null && binding?.messageInputView?.inputEditText != null) {
|
||||
mentionAutocomplete = Autocomplete.on<Mention>(binding?.messageInputView?.inputEditText)
|
||||
.with(elevation)
|
||||
.with(backgroundDrawable)
|
||||
.with(MagicCharPolicy('@'))
|
||||
.with(presenter)
|
||||
.with(callback)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user