Update apps/android/app/src/main/java/chat/simplex/app/model/SimpleXAPI.kt

This commit is contained in:
Evgeny Poberezkin
2022-11-09 09:15:37 +00:00
committed by GitHub
parent 74868fd0a2
commit ea8015e01d

View File

@@ -270,12 +270,12 @@ open class ChatController(var ctrl: ChatCtrl?, val ntfManager: NtfManager, val a
/** Global [ctrl] can be null. It's needed for having the same [ChatModel] that already made in [ChatController] without the need
* to change it everywhere in code after changing a database.
* Since it can be changed in background thread, making this check to prevent NullPointerException */
val ctrl = ctrl
if (ctrl == null) {
val _ctrl = ctrl
if (_ctrl == null) {
receiverStarted = false
break
}
val msg = recvMsg(ctrl)
val msg = recvMsg(_ctrl)
if (msg != null) processReceivedMsg(msg)
}
}