[Android] Prevent NPE in Equalizer

Geoffrey Métais git at videolan.org
Thu Jun 30 10:18:35 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun 30 10:17:32 2016 +0200| [f727867c49c9298f3f53adcd784714ed6e4ab80d] | committer: Geoffrey Métais

Prevent NPE in Equalizer

(cherry picked from commit 0f6898b3b1d80b12bb626f45ad5f8aab527a8b21)

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

 vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
index 65100ea..680070c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
@@ -171,7 +171,8 @@ public class EqualizerFragment extends PlaybackServiceFragment {
             preamp.setProgress((int) mEqualizer.getPreAmp() + 20);
             for (int i = 0; i < BAND_COUNT; ++i) {
                 EqualizerBar bar = (EqualizerBar) bands_layout.getChildAt(i);
-                bar.setValue(mEqualizer.getAmp(i));
+                if (bar != null)
+                    bar.setValue(mEqualizer.getAmp(i));
             }
         }
 



More information about the Android mailing list