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

Commit 267097b0 authored by Christopher Tate's avatar Christopher Tate
Browse files

DO NOT MERGE: Don't crash when we get a drag-ended after being detached

Removing view groups during a drag would cause an NPE here.  The
child views will still get the drag-ended event as expected.

(Cherrypicked from downstream)

Bug 8298439

Change-Id: Ic14cbf9fdc305b91c1627f6882a45d34ee1c34ae
parent 4c333e17
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1152,9 +1152,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                }
                }


                mDragNotifiedChildren.clear();
                mDragNotifiedChildren.clear();
                if (mCurrentDrag != null) {
                    mCurrentDrag.recycle();
                    mCurrentDrag.recycle();
                    mCurrentDrag = null;
                    mCurrentDrag = null;
                }
                }
            }


            // We consider drag-ended to have been handled if one of our children
            // We consider drag-ended to have been handled if one of our children
            // had offered to handle the drag.
            // had offered to handle the drag.