Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kobtea committed Sep 12, 2018
1 parent ed4be1a commit 60cc0d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/todoist/cmd/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ var itemAddCmd = &cobra.Command{
if err != nil {
return errors.New("invalid label name")
}
for _, labelName := range strings.Split(labelNames, ",") {
if label := client.Label.FindOneByName(labelName); label != nil {
item.Labels = append(item.Labels, label.ID)
if len(labelNames) > 0 {
for _, labelName := range strings.Split(labelNames, ",") {
if label := client.Label.FindOneByName(labelName); label != nil {
item.Labels = append(item.Labels, label.ID)
}
}
}

Expand Down

0 comments on commit 60cc0d2

Please sign in to comment.