[Android] Add nullity view nullity check on delete fail

Geoffrey Métais git at videolan.org
Tue Jan 16 15:01:26 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 16 15:00:53 2018 +0100| [d83156355fb639b1443009e8886e910c61682972] | committer: Geoffrey Métais

Add nullity view nullity check on delete fail

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
index 35224bb0a..748c91675 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
@@ -208,7 +208,8 @@ public abstract class MediaBrowserFragment extends PlaybackServiceFragment imple
     }
 
     private void onDeleteFailed(MediaWrapper media) {
-        if (isAdded()) UiTools.snacker(getView(), getString(R.string.msg_delete_failed, media.getTitle()));
+        final View v = getView();
+        if (v != null && isAdded()) UiTools.snacker(v, getString(R.string.msg_delete_failed, media.getTitle()));
     }
 
     protected void showInfoDialog(MediaLibraryItem item) {



More information about the Android mailing list