Fix setText null crash

This commit is contained in:
Mygod
2018-06-02 08:21:29 +08:00
parent dd70e43f6e
commit 171eac12db
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 27 targetSdkVersion 27
resConfigs "zh-rCN" resConfigs "zh-rCN"
versionCode 21 versionCode 22
versionName "1.3.1" versionName "1.3.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} }

View File

@@ -16,7 +16,7 @@ open class AlwaysAutoCompleteEditTextPreference @JvmOverloads constructor(
editText.id = android.R.id.edit editText.id = android.R.id.edit
} }
override fun setText(text: String) { override fun setText(text: String?) {
val oldText = getText() val oldText = getText()
super.setText(text) super.setText(text)
if (!TextUtils.equals(text, oldText)) notifyChanged() if (!TextUtils.equals(text, oldText)) notifyChanged()