Browse Source

Merge pull request #4539 from nextcloud/ezaquarii/fix-npe-crash-in-ocfilelistfragment

Fix NPE crash in OCFileListFragment when action mode is destroyed
Tobias Kaminsky 5 years ago
parent
commit
f64485f279

+ 5 - 2
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) {