浏览代码

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 年之前
父节点
当前提交
f64485f279
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

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