Merge "Add null bg check to switch"

This commit is contained in:
Alan Viverette
2014-04-23 19:54:03 +00:00
committed by Android (Google) Code Review

View File

@@ -799,7 +799,7 @@ public class Switch extends CompoundButton {
thumbDrawable.setBounds(thumbLeft, switchTop, thumbRight, switchBottom);
final Drawable background = getBackground();
if (background.supportsHotspots()) {
if (background != null && background.supportsHotspots()) {
background.setHotspotBounds(thumbLeft, switchTop, thumbRight, switchBottom);
}