mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-08 23:19:55 +00:00
Replace non null check with early return if null
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
747a4646d3
commit
b07aaee140
@ -2147,15 +2147,17 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupWebsocket() {
|
private fun setupWebsocket() {
|
||||||
if (conversationUser != null) {
|
if (conversationUser == null) {
|
||||||
webSocketInstance =
|
return
|
||||||
if (WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id!!) != null) {
|
|
||||||
WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id!!)
|
|
||||||
} else {
|
|
||||||
Log.d(TAG, "magicWebSocketInstance became null")
|
|
||||||
null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webSocketInstance =
|
||||||
|
if (WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id!!) != null) {
|
||||||
|
WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id!!)
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "magicWebSocketInstance became null")
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun pullChatMessages(lookIntoFuture: Int, setReadMarker: Int = 1, xChatLastCommonRead: Int? = null) {
|
fun pullChatMessages(lookIntoFuture: Int, setReadMarker: Int = 1, xChatLastCommonRead: Int? = null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user