[Android] Add view nullity check on delete fail

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


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

Add view nullity check on delete fail

(cherry picked from commit 5570dc22a3022bb59f0bf6cf3b3a4313730b3f1a)

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

 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 8a5678fc9..be5087c93 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