[Android] Prevent NPE in Equalizer

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


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

Prevent NPE in Equalizer

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

 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