[Android] Network browser: Sanity check
Geoffrey Métais
git at videolan.org
Tue May 7 14:39:20 CEST 2019
vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 7 14:39:02 2019 +0200| [564d64bfc546a443eec227ef53b02d50e9fcf9d8] | committer: Geoffrey Métais
Network browser: Sanity check
> https://code.videolan.org/videolan/vlc-android/commit/564d64bfc546a443eec227ef53b02d50e9fcf9d8
---
.../vlc/gui/browser/NetworkBrowserFragment.java | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
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 5d4254fe9..1e29eaa09 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
@@ -34,6 +34,14 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
+import androidx.recyclerview.widget.RecyclerView;
+
import org.jetbrains.annotations.NotNull;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.ExternalMonitor;
@@ -46,14 +54,6 @@ import org.videolan.vlc.util.Util;
import org.videolan.vlc.util.WorkersKt;
import org.videolan.vlc.viewmodels.browser.NetworkModel;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.lifecycle.Observer;
-import androidx.lifecycle.ViewModelProviders;
-import androidx.localbroadcastmanager.content.LocalBroadcastManager;
-import androidx.recyclerview.widget.RecyclerView;
-
public class NetworkBrowserFragment extends BaseBrowserFragment {
@Override
@@ -201,6 +201,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
public void showAddServerDialog(MediaWrapper mw) {
final FragmentManager fm = getFragmentManager();
+ if (fm == null) return;
final NetworkServerDialog dialog = new NetworkServerDialog();
if (mw != null) dialog.setServer(mw);
dialog.show(fm, "fragment_add_server");
More information about the Android
mailing list