Fix crash

This commit is contained in:
世界 2021-01-11 07:31:49 +08:00
parent 5b80ad3af2
commit da2b4e2321
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -28,12 +28,10 @@ object UpdateUtil {
}) { response: TLObject?, error: TLRPC.TL_error? ->
if (error == null) {
val res = response as TLRPC.TL_contacts_resolvedPeer
if (res.chats.isEmpty()) {
return@sendRequest
}
val chat = res.chats.find { it.username == channelUsername } ?: return@sendRequest
messagesCollector.putChats(res.chats, false)
messagesStorage.putUsersAndChats(res.users, res.chats, false, true)
checkFollowChannel(ctx, currentAccount, res.chats.find { it.username == channelUsername }!!)
checkFollowChannel(ctx, currentAccount, chat)
}
}
}