fix(blocked): Add nil check for BlockedBy field
Fixes #74 - prevents panic when BlockedBy is nil Amp-Thread-ID: https://ampcode.com/threads/T-ea606216-b886-4af0-bba8-56d000362d01 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -169,8 +169,12 @@ var blockedCmd = &cobra.Command{
|
|||||||
|
|
||||||
for _, issue := range blocked {
|
for _, issue := range blocked {
|
||||||
fmt.Printf("[P%d] %s: %s\n", issue.Priority, issue.ID, issue.Title)
|
fmt.Printf("[P%d] %s: %s\n", issue.Priority, issue.ID, issue.Title)
|
||||||
|
blockedBy := issue.BlockedBy
|
||||||
|
if blockedBy == nil {
|
||||||
|
blockedBy = []string{}
|
||||||
|
}
|
||||||
fmt.Printf(" Blocked by %d open dependencies: %v\n",
|
fmt.Printf(" Blocked by %d open dependencies: %v\n",
|
||||||
issue.BlockedByCount, issue.BlockedBy)
|
issue.BlockedByCount, blockedBy)
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user