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:
Alexander Jung 2023-01-20 11:34:00 +01:00 committed by Christian Rocha
parent ede4aec24e
commit b217449c8e
1 changed files with 4 additions and 0 deletions

4
tea.go
View File

@ -310,6 +310,10 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) {
go func() {
// Execute commands one at a time, in order.
for _, cmd := range msg {
if cmd == nil {
continue
}
p.Send(cmd())
}
}()