Check for nil listener before printing address (#1946)

* Checking that a server listener is not nil before printing verbose information

* Improved readability of a loop
pull/1921/head^2
insomniac 2017-11-07 17:08:54 +00:00 committed by Matt Holt
parent 5f39cbef94
commit 169ab3acda
1 changed files with 5 additions and 0 deletions

View File

@ -518,6 +518,11 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
}
if !Quiet {
for _, srvln := range inst.servers {
// only show FD notice if the listener is not nil.
// This can happen when only serving UDP or TCP
if srvln.listener == nil {
continue
}
if !IsLoopback(srvln.listener.Addr().String()) {
checkFdlimit()
break