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

Commit 2b65ed77 authored by Chiao Cheng's avatar Chiao Cheng Committed by Android Git Automerger
Browse files

am 4fc5cfb4: Merge "Fix NPE when a view is traversed without a parent." into jb-dev

* commit '4fc5cfb4':
  Fix NPE when a view is traversed without a parent.
parents e8432ae6 4fc5cfb4
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -201,12 +201,16 @@ public class EditorAnimator {
    /**
     * Traverses up the view hierarchy and returns all views below this item. Stops
     * once a parent is not a vertical LinearLayout
     *
     * @return List of views that are below the given view. Empty list if parent of view is null.
     */
    private static List<View> getViewsBelowOf(View view) {
        final ViewGroup victimParent = (ViewGroup) view.getParent();
        final List<View> result = Lists.newArrayList();
        if (victimParent != null) {
            final int index = victimParent.indexOfChild(view);
            getViewsBelowOfRecursive(result, victimParent, index + 1);
        }
        return result;
    }