diff --git a/cmd/yggdrasilctl/main.go b/cmd/yggdrasilctl/main.go index 51c25dcd..3bbdf6ab 100644 --- a/cmd/yggdrasilctl/main.go +++ b/cmd/yggdrasilctl/main.go @@ -190,7 +190,9 @@ func run() int { for _, peer := range resp.Peers { state, lasterr, dir, rtt, rxr, txr := "Up", "-", "Out", "-", "-", "-" if !peer.Up { - state, lasterr = "Down", fmt.Sprintf("%s ago: %s", peer.LastErrorTime.Round(time.Second), peer.LastError) + if state = "Down"; peer.LastError != "" { + lasterr = fmt.Sprintf("%s ago: %s", peer.LastErrorTime.Round(time.Second), peer.LastError) + } } else if rttms := float64(peer.Latency.Microseconds()) / 1000; rttms > 0 { rtt = fmt.Sprintf("%.02fms", rttms) }