[Android] Prevent NPE in videos action mode

Geoffrey Métais git at videolan.org
Fri Dec 29 16:37:48 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 29 16:07:03 2017 +0100| [87db48b4ccee6b6d5fe886e688dfa44deaa625bc] | committer: Geoffrey Métais

Prevent NPE in videos action mode

(cherry picked from commit 7ec8d67e92bd9137be5d91b8ca9225095501d135)

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 17793fde8..49e36cdb2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -458,7 +458,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
         }
         menu.findItem(R.id.action_video_info).setVisible(count == 1);
         menu.findItem(R.id.action_video_play).setVisible(AndroidUtil.isHoneycombOrLater || count == 1);
-        menu.findItem(R.id.action_video_append).setVisible(mService.hasMedia() && AndroidUtil.isHoneycombOrLater);
+        menu.findItem(R.id.action_video_append).setVisible(mService != null && mService.hasMedia() && AndroidUtil.isHoneycombOrLater);
         return true;
     }
 



More information about the Android mailing list