Skip to content

Commit a65916c

Browse files
committed
catch and show exceptions thrown at sending a message
1 parent 7f6343c commit a65916c

File tree

1 file changed

+5
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers

1 file changed

+5
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Messaging.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ fun Context.sendMessage(text: String, addresses: List<String>, subscriptionId: I
7272
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
7373
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
7474
Handler(Looper.getMainLooper()).post {
75-
transaction.sendNewMessage(message)
75+
try {
76+
transaction.sendNewMessage(message)
77+
} catch (e: Exception) {
78+
showErrorToast(e)
79+
}
7680
}
7781
}
7882

0 commit comments

Comments
 (0)