From 9c127d8e17e9b7dd3ee90443a15d899882cc6001 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 25 May 2023 15:29:35 +0530 Subject: [PATCH] Gallery2: Check for null on menuItem update --- src/com/android/gallery3d/app/AlbumPage.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 5f59f2dc3..3fd8f13fd 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -803,8 +803,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster } private void updateMenuItem() { - if (allVideoFiles() && !mGetContent) { - mActionMenu.findItem(R.id.action_slideshow).setVisible(false); + MenuItem actionMenu = mActionMenu.findItem(R.id.action_slideshow); + if (allVideoFiles() && !mGetContent && actionMenu != null) { + actionMenu.setVisible(false); } } -- GitLab