Skip to content
Snippets Groups Projects
Commit e077e792 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Equalizer: Prevent NPE

(cherry picked from commit b504377e)
parent 61a18a93
No related branches found
No related tags found
No related merge requests found
......@@ -195,9 +195,10 @@ class EqualizerFragment : VLCBottomSheetDialogFragment(), CoroutineScope by Main
// Set the default selection asynchronously to prevent a layout initialization bug.
binding.equalizerPresets.post {
val activity = activity ?: return@post
binding.equalizerPresets.onItemSelectedListener = setListener
val pos = allSets.indexOf(VLCOptions.getEqualizerNameFromSettings(requireActivity()))
state.update(pos, VLCOptions.getEqualizerSavedState(requireActivity()))
val pos = allSets.indexOf(VLCOptions.getEqualizerNameFromSettings(activity))
state.update(pos, VLCOptions.getEqualizerSavedState(activity))
updateAlreadyHandled = true
if (binding.equalizerButton.isChecked || !state.saved) {
savePos = pos
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment