Fix crash

This commit is contained in:
Niels Andriesse 2021-05-25 09:17:06 +10:00
parent 5d9957a57d
commit 128116ec36

View File

@ -101,7 +101,8 @@ object OpenGroupManager {
val threadDB = DatabaseFactory.getThreadDatabase(context) val threadDB = DatabaseFactory.getThreadDatabase(context)
val openGroupID = "$server.$room" val openGroupID = "$server.$room"
val threadID = GroupManager.getOpenGroupThreadID(openGroupID, context) val threadID = GroupManager.getOpenGroupThreadID(openGroupID, context)
val groupID = threadDB.getRecipientForThreadId(threadID)!!.address.serialize() val recipient = threadDB.getRecipientForThreadId(threadID) ?: return
val groupID = recipient.address.serialize()
// Stop the poller if needed // Stop the poller if needed
val openGroups = storage.getAllV2OpenGroups().filter { it.value.server == server } val openGroups = storage.getAllV2OpenGroups().filter { it.value.server == server }
if (openGroups.count() == 1) { if (openGroups.count() == 1) {