Bail out if net.Listen returns nil listener with no error

This is highly unlikely, but there is nothing in the net.Listen() that
precludes that possibility.
pull/71/head
Eugene Kim 6 years ago
parent dbc28e6fcf
commit 778784c1ec
  1. 4
      node/node.go

@ -93,6 +93,10 @@ func (node *Node) listenOnPort(port string) {
node.log.Error("Socket listen port failed", "addr", addr, "err", err)
return
}
if listen == nil {
node.log.Error("Listen returned nil", "addr", addr)
return
}
for {
conn, err := listen.Accept()
if err != nil {

Loading…
Cancel
Save