@marcel91200 / caddy Mirror · read-only / commits / c6ac350a
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 04:15 UTC

core: Return default logger if no modules loaded

Fix report from: https://caddy.community/t/remote-caddyfile-invalid-memory-address-or-nil-pointer-dereference/19700/3

Matthew Holt committed Apr 20, 2023 at 10:27 UTC c6ac350a3b53feb1dfcc24d82421cd20da61a163
1 file changed +3
context.go
+3
@@ -480,6 +480,9 @@ func (ctx Context) Logger(module ...Module) *zap.Logger {
480 if len(module) > 0 {
481 mod = module[0]
482 }
483 + if mod == nil {
484 + return Log()
485 + }
486 return ctx.cfg.Logging.Logger(mod)
487 }
488