diff options
author | Alan Pearce | 2024-05-24 18:24:50 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-24 18:24:50 +0200 |
commit | 2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5 (patch) | |
tree | 25d7e6038e893c1d39a7030f2f693f40a7e8c530 /internal/server | |
parent | 042dadb9ee2c8ea32a8cda063732c0d0be62cec6 (diff) | |
download | searchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.tar.lz searchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.tar.zst searchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.zip |
fix: check for nil pointers in NewMux
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/mux.go | 6 |
1 files changed, 6 insertions, 0 deletions
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, }) |