adding a couple crashfixes

This commit is contained in:
tibbi 2018-03-03 12:59:16 +01:00
parent e85dd634e6
commit 3105093272
2 changed files with 8 additions and 4 deletions

View File

@ -95,13 +95,17 @@ abstract class ContactActivity : SimpleActivity() {
fun deleteContact() { fun deleteContact() {
ConfirmationDialog(this) { ConfirmationDialog(this) {
ContactsHelper(this).deleteContact(contact!!) if (contact != null) {
finish() ContactsHelper(this).deleteContact(contact!!)
finish()
}
} }
} }
fun shareContact() { fun shareContact() {
shareContacts(arrayListOf(contact!!)) if (contact != null) {
shareContacts(arrayListOf(contact!!))
}
} }
fun trySendSMS() { fun trySendSMS() {

View File

@ -190,7 +190,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
override fun onQueryTextChange(newText: String): Boolean { override fun onQueryTextChange(newText: String): Boolean {
if (isSearchOpen) { if (isSearchOpen) {
getCurrentFragment().onSearchQueryChanged(newText) getCurrentFragment()?.onSearchQueryChanged(newText)
} }
return true return true
} }