[Android] Browser: Prevent NPE on FAB click

Geoffrey Métais git at videolan.org
Fri Mar 2 10:22:19 CET 2018


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

Browser: Prevent NPE on FAB click

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

 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