Prevent NPE

This commit is contained in:
Milos Kozak 2022-01-07 17:29:26 +01:00
parent 8c06d860e9
commit c165c91d1d

View file

@ -100,7 +100,7 @@ class MedtronicHistoryActivity : DaggerActivity() {
val spinnerAdapter = ArrayAdapter(this, R.layout.spinner_centered, typeListFull) val spinnerAdapter = ArrayAdapter(this, R.layout.spinner_centered, typeListFull)
historyTypeSpinner.adapter = spinnerAdapter historyTypeSpinner.adapter = spinnerAdapter
historyTypeSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { historyTypeSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
if (manualChange) return if (manualChange) return
val selected = historyTypeSpinner.selectedItem as TypeList val selected = historyTypeSpinner.selectedItem as TypeList
showingType = selected showingType = selected