Merge remote branch 'goog/master' into honeycomb-release
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index a2ed985..264e839 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -417,8 +417,12 @@
         if (heightMode == MeasureSpec.AT_MOST) {
             heightSize = maxChildHeight + verticalPadding;
         }
+        if (childCount > 0) {
+            mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
+        } else {
+            mMaxScrollX = 0;
+        }
 
-        mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
         setMeasuredDimension(widthSize, heightSize);
     }