catch exceptions thrown at getting unread conversations

This commit is contained in:
tibbi 2021-11-13 09:08:55 +01:00
parent 8eaafc1d3c
commit 5f11714e6f
1 changed files with 7 additions and 2 deletions

View File

@ -47,11 +47,16 @@ class SmsReceiver : BroadcastReceiver() {
} catch (ignored: Exception) {
}
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
try {
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
} catch (ignored: Exception) {
}
val participant = SimpleContact(0, 0, address, "", arrayListOf(address), ArrayList(), ArrayList())
val participants = arrayListOf(participant)
val messageDate = (date / 1000).toInt()
val message = Message(newMessageId, body, type, status, participants, messageDate, false, threadId, false, null, address, "", subscriptionId)
val message =
Message(newMessageId, body, type, status, participants, messageDate, false, threadId, false, null, address, "", subscriptionId)
context.messagesDB.insertOrUpdate(message)
refreshMessages()
}