[Android] Add nullity check for Snackbar

Geoffrey Métais git at videolan.org
Mon Jan 15 10:03:29 CET 2018


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

Add nullity check for Snackbar

(cherry picked from commit cad08823f8dd3e13b690dc15dfb7babcdcea281d)

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

 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 9ec7c26b7..05adb36b3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -576,7 +576,8 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
                         mAdapter.addItem(mw, true, position);
                     }
                 };
-                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