[Android] Prevent NPE on Activity restoration

Geoffrey Métais git at videolan.org
Mon Nov 7 16:07:10 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov  7 14:58:09 2016 +0100| [8481fa2345fceba90fb10bb28b11564482a3b427] | committer: Geoffrey Métais

Prevent NPE on Activity restoration

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index fa5ec40..e5dd65f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -787,7 +787,8 @@ public class MainActivity extends AudioPlayerContainerActivity implements Device
     }
 
     public void closeSearchView() {
-        MenuItemCompat.collapseActionView(mMenu.findItem(R.id.ml_menu_filter));
+        if (mMenu != null)
+            MenuItemCompat.collapseActionView(mMenu.findItem(R.id.ml_menu_filter));
     }
 
     public void restoreCurrentList() {



More information about the Android mailing list