Skip to content

Commit 3105093

Browse files
committed
adding a couple crashfixes
1 parent e85dd63 commit 3105093

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/activities/ContactActivity.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ abstract class ContactActivity : SimpleActivity() {
9595

9696
fun deleteContact() {
9797
ConfirmationDialog(this) {
98-
ContactsHelper(this).deleteContact(contact!!)
99-
finish()
98+
if (contact != null) {
99+
ContactsHelper(this).deleteContact(contact!!)
100+
finish()
101+
}
100102
}
101103
}
102104

103105
fun shareContact() {
104-
shareContacts(arrayListOf(contact!!))
106+
if (contact != null) {
107+
shareContacts(arrayListOf(contact!!))
108+
}
105109
}
106110

107111
fun trySendSMS() {

app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
190190

191191
override fun onQueryTextChange(newText: String): Boolean {
192192
if (isSearchOpen) {
193-
getCurrentFragment().onSearchQueryChanged(newText)
193+
getCurrentFragment()?.onSearchQueryChanged(newText)
194194
}
195195
return true
196196
}

0 commit comments

Comments
 (0)