From b585d3fa64d370c942ebccdb86400d1dd3b93d26 Mon Sep 17 00:00:00 2001 From: yingrenw Date: Tue, 3 Jan 2017 20:05:15 +0800 Subject: [PATCH] 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 Signed-off-by: Mohammad Hasan Keramat J --- src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java index fde220cbf69..b6fcdf41439 100644 --- a/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java +++ b/src/com/android/launcher3/keyboard/ViewGroupFocusHelper.java @@ -54,7 +54,7 @@ private void computeLocationRelativeToContainer(View child, Rect outRect) { 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));