fix: check for nil pointers in NewMux
Alan Pearce alan@alanpearce.eu
Fri, 24 May 2024 18:24:50 +0200
1 files changed, 6 insertions(+), 0 deletions(-)
jump to
M internal/server/mux.go → internal/server/mux.go
@@ -83,6 +83,12 @@ index *search.ReadIndex, liveReload bool, ) (*http.ServeMux, error) { var err error + if cfg == nil { + return nil, errors.New("cfg is nil") + } + if index == nil { + return nil, errors.New("index is nil") + } sentryHandler := sentryhttp.New(sentryhttp.Options{ Repanic: true, })