adding some crashfixes

This commit is contained in:
tibbi 2021-01-07 23:15:10 +01:00
parent 80517444a4
commit d52b4da80e
1 changed files with 3 additions and 3 deletions

View File

@ -134,17 +134,17 @@ class ThreadAdapter(activity: SimpleActivity, var messages: ArrayList<ThreadItem
} }
private fun copyToClipboard() { private fun copyToClipboard() {
val firstItem = getSelectedItems().first() as? Message ?: return val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
activity.copyToClipboard(firstItem.body) activity.copyToClipboard(firstItem.body)
} }
private fun shareText() { private fun shareText() {
val firstItem = getSelectedItems().first() as? Message ?: return val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
activity.shareTextIntent(firstItem.body) activity.shareTextIntent(firstItem.body)
} }
private fun selectText() { private fun selectText() {
val firstItem = getSelectedItems().first() as? Message ?: return val firstItem = getSelectedItems().firstOrNull() as? Message ?: return
if (firstItem.body.trim().isNotEmpty()) { if (firstItem.body.trim().isNotEmpty()) {
SelectTextDialog(activity, firstItem.body) SelectTextDialog(activity, firstItem.body)
} }