Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06d80c29 authored by Zemiao Zhu's avatar Zemiao Zhu Committed by Automerger Merge Worker
Browse files

Merge "Fix potential crash in SearchFragment#dismiss()." into rvc-dev am: 51f5c340 am: c804ee95

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/DocumentsUI/+/12042990

Change-Id: I45106283a5f3e504de2a0146d7019c89642fef01
parents 188c7294 c804ee95
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public class SearchFragment extends Fragment{

    public static void dismissFragment(FragmentManager fm) {
        SearchFragment fragment = get(fm);
        if (fragment != null) {
        if (fragment != null && fragment.getActivity() != null) {
            fragment.dismiss();
        }
    }
@@ -154,6 +154,11 @@ public class SearchFragment extends Fragment{
    }

    private void dismiss() {
        if (getActivity() == null) {
            // Fragment has already been detached from activity.
            return;
        }

        updateDirectoryVisibility(View.VISIBLE);

        FragmentTransaction ft = getParentFragmentManager().beginTransaction();