fix a crash at receiving MMS

This commit is contained in:
tibbi 2020-09-23 10:08:07 +02:00
parent bbe98a9bf0
commit 97fabfec1a
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ class MmsReceiver : com.klinker.android.send_message.MmsReceivedReceiver() {
Handler(Looper.getMainLooper()).post {
context.showReceivedMessageNotification(address, mms.body, mms.thread, glideBitmap)
val conversation = context.getConversations(mms.thread.toLong()).firstOrNull() ?: return@post
context.conversationsDB.insertOrUpdate(conversation)
ensureBackgroundThread {
context.conversationsDB.insertOrUpdate(conversation)
}
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
}
}