Skip to content

Commit

Permalink
fix "ip get" when no facility is assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
displague committed Jul 10, 2020
1 parent c736b47 commit a990cc1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/retrieve_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ packet ip get --reservation-id [reservation_UUID]
data := make([][]string, len(ips))

for i, ip := range ips {
data[i] = []string{ip.ID, ip.Address, ip.Facility.Code, strconv.FormatBool(ip.Public), ip.Created}
code := ""
if ip.Facility != nil {
code = ip.Facility.Code
}
data[i] = []string{ip.ID, ip.Address, code, strconv.FormatBool(ip.Public), ip.Created}
}
header := []string{"ID", "Address", "Facility", "Public", "Created"}

Expand Down

0 comments on commit a990cc1

Please sign in to comment.