From d803561212a81f71509356cfcb276879d55ebf4f Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 29 Oct 2019 00:08:06 -0600 Subject: caddyhttp: Fix nil pointer dereference --- modules/caddyhttp/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index 2c0c44e..c82f74d 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -136,7 +136,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { if err != nil { // prepare the error log logger := errLog - if s.Logs.LoggerNames != nil { + if s.Logs != nil && s.Logs.LoggerNames != nil { logger = logger.Named(s.Logs.LoggerNames[r.Host]) } -- cgit v1.2.3