diff options
| author | Alan Viverette <alanv@google.com> | 2014-04-23 12:51:16 -0700 |
|---|---|---|
| committer | Alan Viverette <alanv@google.com> | 2014-04-23 12:51:16 -0700 |
| commit | aec98fee141c268660e23d0ea675a2f709b00335 (patch) | |
| tree | c3d65ab0065b52b13e9308b3ab98e9c52b5a1d83 /core/java/android/widget/Switch.java | |
| parent | 40619ae8016248979c0147f6bcc9bfd41f07bb4a (diff) | |
Add null bg check to switch
BUG: 14271950
Change-Id: I6f4833c916ddc8d939f5bfa6ab7b1ed1993e862e
Diffstat (limited to 'core/java/android/widget/Switch.java')
| -rw-r--r-- | core/java/android/widget/Switch.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java index d013e7b6eef0..08af4dee6c64 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -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); } |
