[Android] Browser: Prevent NPE on FAB click

Geoffrey Métais git at videolan.org
Wed Mar 7 15:22:38 CET 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  2 09:36:57 2018 +0100| [fdbb708da37c325b1f5688eafead0a30658e65d9] | committer: Geoffrey Métais

Browser: Prevent NPE on FAB click

(cherry picked from commit fd411dbd5dd6249a35651c4b6b12ef359d799248)

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

 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index b2023b447..3e75e0b5f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -631,7 +631,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
                         positionInPlaylist = mediaLocations.size() - 1;
                 }
             }
-        MediaUtils.openList(getActivity(), mediaLocations, positionInPlaylist);
+        if (getActivity() != null) MediaUtils.openList(getActivity(), mediaLocations, positionInPlaylist);
     }
 
     private final List<MediaLibraryItem> currentMediaList = new ArrayList<>();



More information about the Android mailing list