From 9b4c0a33084c1af69a692c44f7cdf755df69ce8f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 3 Jul 2022 18:51:44 +0200 Subject: [PATCH] adding some null checks at menu items --- .../contacts/pro/activities/ViewContactActivity.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt index 9029a0da..a7720517 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt @@ -109,7 +109,9 @@ class ViewContactActivity : ContactActivity() { } findItem(R.id.edit).setOnMenuItemClickListener { - launchEditContact(contact!!) + if (contact != null) { + launchEditContact(contact!!) + } true } @@ -294,8 +296,10 @@ class ViewContactActivity : ContactActivity() { } private fun openWith() { - val uri = getContactPublicUri(contact!!) - launchViewContactIntent(uri) + if (contact != null) { + val uri = getContactPublicUri(contact!!) + launchViewContactIntent(uri) + } } private fun setupFavorite() {