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

Commit 0621742d authored by Adam Powell's avatar Adam Powell
Browse files

Fix setting null target fragments

Bug 34869013
Test: CTS

Change-Id: Ibeed66f9a889a8e395bfabedcf22aebcbb848908
parent 4a0ae490
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -767,7 +767,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        // We'll have the FragmentManager check that for validity when we move
        // the fragments to a valid state.
        final FragmentManager mine = getFragmentManager();
        final FragmentManager theirs = fragment.getFragmentManager();
        final FragmentManager theirs = fragment != null ? fragment.getFragmentManager() : null;
        if (mine != null && theirs != null && mine != theirs) {
            throw new IllegalArgumentException("Fragment " + fragment
                    + " must share the same FragmentManager to be set as a target fragment");