[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Wed Aug 30 16:49:51 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Aug 30 16:40:46 2017 +0200| [7e190a46850b390dbbb3f6d8cc7062705f17cd45] | committer: Geoffrey Métais

Prevent NPE

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

 .../src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
index 3e6d9c927..aba8437aa 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
@@ -236,8 +236,11 @@ public abstract class SortedBrowserFragment extends BrowseFragment implements Br
             ListItem item = new ListItem(letter, mw);
             mMediaItemMap.put(letter, item);
         }
-        ((BrowserActivityInterface)getActivity()).showProgress(false);
-        ((BrowserActivityInterface)getActivity()).updateEmptyView(false);
+        final Activity activity = getActivity();
+        if (activity != null) {
+            ((BrowserActivityInterface)activity).showProgress(false);
+            ((BrowserActivityInterface)activity).updateEmptyView(false);
+        }
         mHandler.removeMessages(HIDE_LOADING);
     }
 



More information about the Android mailing list