Skip to content

Commit

Permalink
fix(dl): dl dialogs range
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Nov 24, 2022
1 parent 72844d8 commit f82ac32
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/dl/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ func newIter(client *tg.Client, kvd kv.KV, tmpl string, items ...[]*dialog) (*it
mm := make([]*dialog, 0)

for _, m := range items {
if len(m) == 0 {
continue
}
mm = append(mm, m...)
}

// if msgs is empty, return error to avoid range out of index
if len(mm) == 0 {
return nil, fmt.Errorf("you must specify at least one message")
}

return &iter{
client: client,
dialogs: mm,
Expand Down

0 comments on commit f82ac32

Please sign in to comment.