From 2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 May 2024 18:24:50 +0200 Subject: fix: check for nil pointers in NewMux --- internal/server/mux.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/server') diff --git a/internal/server/mux.go b/internal/server/mux.go index c5ba97a..c2469ad 100644 --- a/internal/server/mux.go +++ b/internal/server/mux.go @@ -83,6 +83,12 @@ func NewMux( 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, }) -- cgit 1.4.1