From 44625ae5b03db07b390bbb39fadfb35aa0a4c50f Mon Sep 17 00:00:00 2001 From: Mygod Date: Mon, 11 Jul 2016 20:43:50 +0800 Subject: [PATCH] Bugfix for DropDownPreference --- .../com/github/shadowsocks/preferences/DropDownPreference.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala b/src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala index 4e88fd52..6523749c 100644 --- a/src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala +++ b/src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala @@ -120,7 +120,7 @@ final class DropDownPreference(private val mContext: Context, attrs: AttributeSe * * @return The value of the key. */ - def getValue = if (mEntryValues == null) null else mEntryValues(mSelectedIndex).toString + def getValue = if (mEntryValues == null || mSelectedIndex < 0) null else mEntryValues(mSelectedIndex).toString /** * Returns the entry corresponding to the current value.