[Android] Fix UninitializedPropertyAccessException

Nicolas Pomepuy git at videolan.org
Tue Oct 1 14:44:32 CEST 2019


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Sep 26 09:05:14 2019 +0200| [6d355119f19804e08f49a037acf662b487637248] | committer: Geoffrey Métais

Fix UninitializedPropertyAccessException

(cherry picked from commit 124c4fd00bb422aab8c141d2abd816ce4ddf03e1)

> https://code.videolan.org/videolan/vlc-android/commit/6d355119f19804e08f49a037acf662b487637248
---

 vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
index cf7827ba6..31ddc5c5c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
@@ -35,7 +35,6 @@ import androidx.databinding.DataBindingUtil
 import androidx.databinding.ObservableBoolean
 import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED
 import kotlinx.coroutines.*
-import org.videolan.libvlc.LibVLC
 import org.videolan.libvlc.MediaPlayer
 import org.videolan.tools.isStarted
 import org.videolan.vlc.BuildConfig
@@ -222,7 +221,7 @@ class EqualizerFragment : VLCBottomSheetDialogFragment(), CoroutineScope by Main
         binding.equalizerPreamp.setOnSeekBarChangeListener(null)
         if (binding.equalizerButton.isChecked) {
             val pos = binding.equalizerPresets.selectedItemPosition
-            VLCOptions.saveEqualizerInSettings(requireActivity(), equalizer, allSets[pos], true, state.saved)
+            if (::equalizer.isInitialized) VLCOptions.saveEqualizerInSettings(requireActivity(), equalizer, allSets[pos], true, state.saved)
         } else {
             VLCOptions.saveEqualizerInSettings(requireActivity(), MediaPlayer.Equalizer.createFromPreset(0), allSets[0], false, true)
         }



More information about the Android mailing list