From 551c4d3f1a09e2a42f6076c65e229a019f24aad5 Mon Sep 17 00:00:00 2001 From: Chris Narkiewicz Date: Sun, 22 Sep 2019 20:22:57 +0100 Subject: [PATCH] Fix NPE crash in OCFileListFragment when action mode is destroyed Fixes #4438 Signed-off-by: Chris Narkiewicz --- .../owncloud/android/ui/fragment/OCFileListFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 194575d3ed..ab26974836 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -643,8 +643,11 @@ public class OCFileListFragment extends ExtendedListFragment implements mActiveActionMode = null; // reset to previous color - ThemeUtils.colorStatusBar(getActivity(), mSystemBarColor); - ThemeUtils.colorToolbarProgressBar(getActivity(), mProgressBarColor); + final FragmentActivity activity = getActivity(); + if (activity != null) { + ThemeUtils.colorStatusBar(activity, mSystemBarColor); + ThemeUtils.colorToolbarProgressBar(activity, mProgressBarColor); + } // show FAB on multi selection mode exit if (!mHideFab && !searchFragment) {