summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-10-29 00:08:06 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-10-29 00:08:06 -0600
commitd803561212a81f71509356cfcb276879d55ebf4f (patch)
tree5bae432648874b0f5908ffe5b7d3e04a7f001b63
parent813fff05844f4aee35bdca37eab76eddeb57d2dd (diff)
caddyhttp: Fix nil pointer dereference
-rw-r--r--modules/caddyhttp/server.go2
1 files changed, 1 insertions, 1 deletions
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])
}