Not listening!

This commit is contained in:
Matt Joiner 2015-02-25 14:52:19 +11:00
parent 48dc85bfd3
commit 295b71c09b
1 changed files with 5 additions and 1 deletions

View File

@ -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 {