From 295b71c09b7aebfb1a5ece74ffd47d4c5c19a804 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 25 Feb 2015 14:52:19 +1100 Subject: [PATCH] Not listening! --- client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 25b0317c..83d77b3b 100644 --- a/client.go +++ b/client.go @@ -197,7 +197,11 @@ func (cl *Client) WriteStatus(_w io.Writer) { defer cl.mu.RUnlock() w := bufio.NewWriter(_w) defer w.Flush() - fmt.Fprintf(w, "Listening on %s\n", cl.ListenAddr()) + if addr := cl.ListenAddr(); addr != nil { + fmt.Fprintf(w, "Listening on %s\n", cl.ListenAddr()) + } else { + fmt.Println("Not listening!") + } fmt.Fprintf(w, "Peer ID: %q\n", cl.peerID) fmt.Fprintf(w, "Handshaking: %d\n", cl.handshaking) if cl.dHT != nil {