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

Commit 254c25f3 authored by Kevin's avatar Kevin
Browse files

Fix NPE from onChildVisibilityChanged.

Removing the child whose visibility changed in
ViewGroup#OnChildVisibilityChanged causes a null pointer exception since
the parent is null immediately after.  This CL prevents that from
keeping the parent stored.

Bug: 117520801
Test: remove child in OnChildVisibilityChanged, observe no crash
Change-Id: Ifd20c2fcba9aee476a7714794a90c7ec9a0b3b84
parent c4cfbf48
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -14255,9 +14255,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
            if (mParent instanceof ViewGroup) {
                ((ViewGroup) mParent).onChildVisibilityChanged(this,
                        (changed & VISIBILITY_MASK), newVisibility);
                ((View) mParent).invalidate(true);
                ViewGroup parent = (ViewGroup) mParent;
                parent.onChildVisibilityChanged(this, (changed & VISIBILITY_MASK),
                        newVisibility);
                parent.invalidate(true);
            } else if (mParent != null) {
                mParent.invalidateChild(this, null);
            }