[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Tue Mar 29 13:31:59 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 29 11:54:55 2016 +0200| [b82ff59834a7f7671c254b2459f90be74a313af3] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index bff6c8d..caa6ac5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -61,6 +61,8 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
 
     private void focusHelper(boolean idIsEmpty) {
         MainActivity main = (MainActivity)getActivity();
+        if (main == null)
+            return;
         main.setMenuFocusDown(idIsEmpty, android.R.id.list);
         main.setSearchAsFocusDown(idIsEmpty, getView(),
                 android.R.id.list);



More information about the Android mailing list