diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt index 187512f77..4cf61c63d 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatSpinner.kt @@ -18,6 +18,9 @@ class MyAppCompatSpinner : AppCompatSpinner { constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) fun setColors(textColor: Int, accentColor: Int, backgroundColor: Int) { + if (adapter == null) + return + val cnt = adapter.count val items = kotlin.arrayOfNulls(cnt) for (i in 0..cnt - 1)