[Android] Add nullity check for Snackbar

Geoffrey Métais git at videolan.org
Mon Jan 15 09:58:42 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 15 09:43:41 2018 +0100| [cad08823f8dd3e13b690dc15dfb7babcdcea281d] | committer: Geoffrey Métais

Add nullity check for Snackbar

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index d4061d3c0..d6e1c4b4a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -558,7 +558,8 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
                         mAdapter.addItem(mw, true);
                     }
                 };
-                UiTools.snackerWithCancel(getView(), getString(R.string.file_deleted), new Runnable() {
+                final View v = getView();
+                if (v != null) UiTools.snackerWithCancel(v, getString(R.string.file_deleted), new Runnable() {
                     @Override
                     public void run() {
                         deleteMedia(mw, false, cancel);



More information about the Android mailing list