Launcher3: Stability NullPointer issue

Description:
Compute a child location by recursion, it
may not have parent view.

When the child doesn't have parent, should
break the recursive.

Change-Id: I8707712b85c10bf1c1d3860c5b8323aefd455cf2
CRs-Fixed: 1104931
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
This commit is contained in:
yingrenw
2017-01-03 20:05:15 +08:00
committed by MrSluffy
parent 97c45a0a26
commit b585d3fa64

View File

@@ -54,7 +54,7 @@ public class ViewGroupFocusHelper extends FocusIndicatorHelper {
outRect.left += child.getX();
outRect.top += child.getY();
if (parent != mContainer) {
if (parent != null && parent != mContainer) {
if (parent instanceof PagedView) {
PagedView page = (PagedView) parent;
outRect.left -= page.getScrollForPage(page.indexOfChild(child));