caddyhttp: Fix nil pointer dereference

This commit is contained in:
Matthew Holt 2019-10-29 00:08:06 -06:00
parent 813fff0584
commit d803561212
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -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])
}