fix: handle nil cmds in tea.Sequentially (#214)

This commit is contained in:
Ajeet D'Souza 2022-02-02 07:22:49 +05:30 committed by GitHub
parent 77e63ac890
commit 7d18632ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ func Tick(d time.Duration, fn func(time.Time) Msg) Cmd {
func Sequentially(cmds ...Cmd) Cmd { func Sequentially(cmds ...Cmd) Cmd {
return func() Msg { return func() Msg {
for _, cmd := range cmds { for _, cmd := range cmds {
if cmd == nil {
continue
}
if msg := cmd(); msg != nil { if msg := cmd(); msg != nil {
return msg return msg
} }