You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a button's Icon field is set directly instead of through SetIcon, then it effectively cannot be disabled due to a nil dereference of b.button.disabledIcon in the renderer.
To Reproduce:
Steps to reproduce the behaviour:
Create a button by setting the Icon field directly.
Disable the button by calling theButton.Disable().
Where the crash happens:
func (b*buttonRenderer) Refresh() {
/* ... */ifb.button.Disabled() {
// if the icon has changed, create a new disabled version// if we could be sure that button.Icon is only ever set through the button.SetIcon method, we could remove thisif!strings.HasSuffix(b.button.disabledIcon.Name(), b.button.Icon.Name()) { // <<< boomb.icon.Resource=theme.NewDisabledResource(b.button.Icon)
} else {
b.icon.Resource=b.button.disabledIcon
}
} else {
b.icon.Resource=b.button.Icon
}
/* ... */
}
Describe the bug:
When a button's Icon field is set directly instead of through
SetIcon
, then it effectively cannot be disabled due to a nil dereference ofb.button.disabledIcon
in the renderer.To Reproduce:
Steps to reproduce the behaviour:
theButton.Disable()
.Where the crash happens:
Example code:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: