add an extra check to avoid saving null contact

This commit is contained in:
tibbi 2018-03-16 09:58:53 +01:00
parent aa8186af56
commit 1dd37336f7
1 changed files with 5 additions and 5 deletions

View File

@ -33,10 +33,10 @@ import org.joda.time.format.DateTimeFormat
import java.util.*
class EditContactActivity : ContactActivity() {
val DEFAULT_EMAIL_TYPE = CommonDataKinds.Email.TYPE_HOME
val DEFAULT_PHONE_NUMBER_TYPE = CommonDataKinds.Phone.TYPE_MOBILE
val DEFAULT_ADDRESS_TYPE = CommonDataKinds.StructuredPostal.TYPE_HOME
val DEFAULT_EVENT_TYPE = CommonDataKinds.Event.TYPE_BIRTHDAY
private val DEFAULT_EMAIL_TYPE = CommonDataKinds.Email.TYPE_HOME
private val DEFAULT_PHONE_NUMBER_TYPE = CommonDataKinds.Phone.TYPE_MOBILE
private val DEFAULT_ADDRESS_TYPE = CommonDataKinds.StructuredPostal.TYPE_HOME
private val DEFAULT_EVENT_TYPE = CommonDataKinds.Event.TYPE_BIRTHDAY
private val INTENT_TAKE_PHOTO = 1
private val INTENT_CHOOSE_PHOTO = 2
@ -490,7 +490,7 @@ class EditContactActivity : ContactActivity() {
}
private fun saveContact() {
if (isSaving) {
if (isSaving || contact == null) {
return
}