summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/trebuchet/PagedView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/PagedView.java')
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/trebuchet/PagedView.java b/src/com/cyanogenmod/trebuchet/PagedView.java
index 0076b831d..667aab27a 100644
--- a/src/com/cyanogenmod/trebuchet/PagedView.java
+++ b/src/com/cyanogenmod/trebuchet/PagedView.java
@@ -1631,7 +1631,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int getChildWidth(int index) {
// This functions are called enough times that it actually makes a difference in the
// profiler -- so just inline the max() here
- final int measuredWidth = getPageAt(index).getMeasuredWidth();
+ final int measuredWidth = getPageAt(index) != null ? getPageAt(index).getMeasuredWidth() : 0;
final int minWidth = mMinimumWidth;
return (minWidth > measuredWidth) ? minWidth : measuredWidth;
}
@@ -1639,7 +1639,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int getChildHeight(int index) {
// This functions are called enough times that it actually makes a difference in the
// profiler -- so just inline the max() here
- final int measuredHeight = getPageAt(index).getMeasuredHeight();
+ final int measuredHeight = getPageAt(index) != null ? getPageAt(index).getMeasuredHeight() : 0;
final int minHeight = mMinimumHeight;
return (minHeight > measuredHeight) ? minHeight : measuredHeight;
}