[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Mon Nov 26 16:13:16 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 26 14:53:03 2018 +0100| [05fb6b736f81fb95e2ebfaf8e2fcd4321ee696b1] | committer: Geoffrey Métais

Prevent NPE

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

 vlc-android/src/org/videolan/vlc/gui/ContentActivity.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
index 86b751984..7be26e0d3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
@@ -195,7 +195,10 @@ public class ContentActivity extends AudioPlayerContainerActivity implements Sea
     }
 
     public void closeSearchView() {
-        if (mToolbar.getMenu() != null) mToolbar.getMenu().findItem(R.id.ml_menu_filter).collapseActionView();
+        if (mToolbar.getMenu() != null) {
+            final MenuItem item = mToolbar.getMenu().findItem(R.id.ml_menu_filter);
+            item.collapseActionView();
+        }
     }
 
     public void restoreCurrentList() {



More information about the Android mailing list