summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-10-09 15:15:24 -0700
committerAdam Cohen <adamcohen@google.com>2013-10-09 15:21:36 -0700
commit558f1c2ac73c3a0c3c0c316222b6b7f9c76e2501 (patch)
tree3989e5488a6bda0595a096307754d1577ed02de2 /src
parent564a2e7116b026c1d73829e65d47b660b03a3c72 (diff)
downloadandroid_packages_apps_Trebuchet-558f1c2ac73c3a0c3c0c316222b6b7f9c76e2501.tar.gz
android_packages_apps_Trebuchet-558f1c2ac73c3a0c3c0c316222b6b7f9c76e2501.tar.bz2
android_packages_apps_Trebuchet-558f1c2ac73c3a0c3c0c316222b6b7f9c76e2501.zip
Fix NPE in CellLayout (issue 11113502)
Change-Id: I8dafa79f68efdda5402e8b228ea3e81d77549a03
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/CellLayout.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 07346f0cc..e3312d557 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -492,10 +492,12 @@ public class CellLayout extends ViewGroup {
int width, height;
cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
View child = getChildAt(fra.mCellX, fra.mCellY);
- int centerX = mTempLocation[0] + mCellWidth / 2;
- int centerY = mTempLocation[1] + previewOffset / 2 +
- child.getPaddingTop() + grid.folderBackgroundOffset;
+
if (child != null) {
+ int centerX = mTempLocation[0] + mCellWidth / 2;
+ int centerY = mTempLocation[1] + previewOffset / 2 +
+ child.getPaddingTop() + grid.folderBackgroundOffset;
+
// Draw outer ring, if it exists
if (FolderIcon.HAS_OUTER_RING) {
d = FolderRingAnimator.sSharedOuterRingDrawable;