Fix NPE when inflating GradientDrawables.

Change-Id: If624d6efac61dabe6009ee4368ad7b119e1d4dcd
This commit is contained in:
Tim Kilbourn
2014-03-25 10:13:02 -07:00
parent 0a8596dc0c
commit 803d91b2b2

View File

@@ -1009,7 +1009,7 @@ public class GradientDrawable extends Drawable {
}
if (state.mInnerRadius == -1
&& themeAttrs == null || themeAttrs[R.styleable.GradientDrawable_thicknessRatio] == 0) {
&& (themeAttrs == null || themeAttrs[R.styleable.GradientDrawable_thicknessRatio] == 0)) {
state.mInnerRadiusRatio = a.getFloat(
R.styleable.GradientDrawable_innerRadiusRatio, DEFAULT_INNER_RADIUS_RATIO);
}
@@ -1020,7 +1020,7 @@ public class GradientDrawable extends Drawable {
}
if (state.mThickness == -1
&& themeAttrs == null || themeAttrs[R.styleable.GradientDrawable_thicknessRatio] == 0) {
&& (themeAttrs == null || themeAttrs[R.styleable.GradientDrawable_thicknessRatio] == 0)) {
state.mThicknessRatio = a.getFloat(
R.styleable.GradientDrawable_thicknessRatio, DEFAULT_THICKNESS_RATIO);
}