[Android] Prevent NPE in network browser

Geoffrey Métais git at videolan.org
Tue Oct 3 16:53:45 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct  3 16:37:11 2017 +0200| [477dd4784124ed5024b023114b6dac2f135db497] | committer: Geoffrey Métais

Prevent NPE in network browser

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

 .../src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java        | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
index 005baddb8..65d07111b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
@@ -254,6 +254,8 @@ public class NetworkBrowserFragment extends BaseBrowserFragment implements Exter
      * Update views visibility and emptiness info
      */
     protected void updateEmptyView() {
+        if (mEmptyView == null)
+            return;
         if (ExternalMonitor.isConnected()) {
             if (mAdapter.isEmpty()) {
                 if (mSwipeRefreshLayout == null || mSwipeRefreshLayout.isRefreshing()) {



More information about the Android mailing list