Merge "Add null bg check to switch"
This commit is contained in:
committed by
Android (Google) Code Review
commit
6f6e64a7a3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user