mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-30 18:56:23 +00:00
Prevent crash if composing is sent when chat room not initialized yet
This commit is contained in:
parent
0625239477
commit
e5795ea05f
1 changed files with 4 additions and 1 deletions
|
|
@ -191,6 +191,7 @@ class SendMessageInConversationViewModel
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
fun configureChatRoom(room: ChatRoom) {
|
fun configureChatRoom(room: ChatRoom) {
|
||||||
|
Log.i("$TAG Chat room configured")
|
||||||
chatRoom = room
|
chatRoom = room
|
||||||
coreContext.postOnCoreThread {
|
coreContext.postOnCoreThread {
|
||||||
chatRoom.addListener(chatRoomListener)
|
chatRoom.addListener(chatRoomListener)
|
||||||
|
|
@ -324,7 +325,9 @@ class SendMessageInConversationViewModel
|
||||||
@UiThread
|
@UiThread
|
||||||
fun notifyChatMessageIsBeingComposed() {
|
fun notifyChatMessageIsBeingComposed() {
|
||||||
coreContext.postOnCoreThread {
|
coreContext.postOnCoreThread {
|
||||||
chatRoom.compose()
|
if (::chatRoom.isInitialized) {
|
||||||
|
chatRoom.compose()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue