adding some crashfixes

This commit is contained in:
tibbi 2021-03-15 23:30:56 +01:00
parent 6c9d25d16f
commit 0e07117b3a
3 changed files with 15 additions and 6 deletions

View file

@ -507,8 +507,12 @@ fun Context.insertNewSMS(address: String, subject: String, body: String, date: L
put(Sms.SUBSCRIPTION_ID, subscriptionId)
}
val newUri = contentResolver.insert(uri, contentValues)
return newUri?.lastPathSegment?.toLong() ?: 0L
return try {
val newUri = contentResolver.insert(uri, contentValues)
newUri?.lastPathSegment?.toLong() ?: 0L
} catch (e: Exception) {
0L
}
}
fun Context.deleteConversation(threadId: Long) {