Fix crash

This commit is contained in:
nielsandriesse 2020-10-27 09:42:39 +11:00
parent 53a58acbd5
commit 4e69a538cb

View File

@ -24,8 +24,8 @@ class PublicChatManager(private val context: Context) {
var areAllCaughtUp = true var areAllCaughtUp = true
refreshChatsAndPollers() refreshChatsAndPollers()
for ((threadID, chat) in chats) { for ((threadID, chat) in chats) {
val poller = pollers[threadID] ?: PublicChatPoller(context, chat) val poller = pollers[threadID]
areAllCaughtUp = areAllCaughtUp && poller.isCaughtUp areAllCaughtUp = if(poller != null) areAllCaughtUp && poller.isCaughtUp else false
} }
return areAllCaughtUp return areAllCaughtUp
} }