Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 8a61f6d

Browse files
Fix case of issue milestone nil
1 parent 3a53ead commit 8a61f6d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commands/issue/detail.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,19 @@ Labels: %s
6767
stateColor = color.New(color.FgRed).SprintFunc()
6868
}
6969

70+
milestone := ""
71+
if issue.Milestone != nil {
72+
milestone = issue.Milestone.Title
73+
}
74+
7075
detial := fmt.Sprintf(base,
7176
yellow(issue.IID),
7277
cyan(issue.Title),
7378
stateColor(issue.State),
7479
issue.Author.Name,
7580
issue.CreatedAt.String(),
7681
issue.Assignee.Name,
77-
issue.Milestone.Title,
82+
milestone,
7883
strings.Join(issue.Labels, ", "),
7984
internal.SweepMarkdownComment(issue.Description),
8085
)

0 commit comments

Comments
 (0)