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

Commit 7d8d7a16 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

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

Change-Id: I48753c349a620029cd4597f70ddb742f43f6a045
parents 12608d30 51f5c340
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();