hide the Equalizer setting item if MusicService isnt initialized

This commit is contained in:
tibbi 2020-10-23 12:13:23 +02:00
parent d3be7527e3
commit f54f1325d5

View file

@ -84,7 +84,12 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupEqualizer() {
val equalizer = MusicService.mEqualizer ?: return
val equalizer = MusicService.mEqualizer
if (equalizer == null) {
settings_equalizer_holder.beGone()
return
}
val items = arrayListOf<RadioItem>()
try {
(0 until equalizer.numberOfPresets).mapTo(items) { RadioItem(it, equalizer.getPresetName(it.toShort())) }