mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: Check msg cmd is not nil before invoking
GitHub-Fixes: #639 Signed-off-by: Alexander Jung <alex@nderjung.net>
This commit is contained in:
committed by
Christian Rocha
parent
ede4aec24e
commit
b217449c8e
4
tea.go
4
tea.go
@@ -310,6 +310,10 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) {
|
|||||||
go func() {
|
go func() {
|
||||||
// Execute commands one at a time, in order.
|
// Execute commands one at a time, in order.
|
||||||
for _, cmd := range msg {
|
for _, cmd := range msg {
|
||||||
|
if cmd == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
p.Send(cmd())
|
p.Send(cmd())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user