Fix crash on unknown plugin

This commit is contained in:
Mygod
2017-01-23 03:42:59 +08:00
parent 974c254460
commit 6fb7330e36
@@ -41,7 +41,9 @@ class IconListPreference(context: Context, attrs: AttributeSet = null) extends L
// a.recycle()
// }
def getEntryIcon: Drawable = mEntryIcons(selectedEntry)
def getEntryIcon: Drawable = try mEntryIcons(selectedEntry) catch {
case _: ArrayIndexOutOfBoundsException => null
}
def getEntryIcons: Array[Drawable] = mEntryIcons
def setEntryIcons(entryIcons: Array[Drawable]): Unit = mEntryIcons = entryIcons