From 97fabfec1afeed2a5d631e81e115b49de3d4cc69 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 23 Sep 2020 10:08:07 +0200 Subject: [PATCH] fix a crash at receiving MMS --- .../simplemobiletools/smsmessenger/receivers/MmsReceiver.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/MmsReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/MmsReceiver.kt index 920eb34f..e2dc15f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/MmsReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/MmsReceiver.kt @@ -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()) } }