From 169ab3acda6a8d5e436c91b47fba7c8719d77c2c Mon Sep 17 00:00:00 2001 From: insomniac Date: Tue, 7 Nov 2017 17:08:54 +0000 Subject: [PATCH] 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 --- caddy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/caddy.go b/caddy.go index 032d8721..8da6d4db 100644 --- a/caddy.go +++ b/caddy.go @@ -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