[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Fri Nov 21 18:04:10 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Nov 21 18:03:02 2014 +0100| [c8d22e0363ed149075a1e6a12486e75ac00d791b] | committer: Geoffrey Métais

Prevent NPE

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c8d22e0363ed149075a1e6a12486e75ac00d791b
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 5105869..b9524f0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -182,6 +182,8 @@ public class AudioBrowserFragment extends Fragment {
     private void focusHelper(final boolean idIsEmpty, final int listId) {
         final View parent = getView();
         final MainActivity main = (MainActivity)getActivity();
+        if (main == null)
+            return;
         main.runOnUiThread(new Runnable() {
             @Override
             public void run() {



More information about the Android mailing list