Fixed some CommandWidget bugs related to transmitting unneeded updates further.
This commit is contained in:
parent
1d543bf444
commit
d500d84de6
2 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,7 @@ func newAction(a Action) *action {
|
|||
}
|
||||
|
||||
func (a *action) Act(c *Context) {
|
||||
if a.Action != nil {
|
||||
if a != nil && a.Action != nil {
|
||||
a.Action.Act(c)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,6 +172,7 @@ func (widget *CommandWidget) Serve(c *Context, updates chan *Update) error {
|
|||
c.Run(widget.Usage, u)
|
||||
continue
|
||||
}
|
||||
|
||||
c.Run(cmd.Action, u)
|
||||
if cmd.Widget != nil {
|
||||
if cmdUpdates != nil {
|
||||
|
@ -187,6 +188,7 @@ func (widget *CommandWidget) Serve(c *Context, updates chan *Update) error {
|
|||
cmdUpdates = nil
|
||||
}()
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if cmdUpdates != nil {
|
||||
|
|
Loading…
Reference in a new issue