about summary refs log tree commit diff stats
path: root/internal/server/mux.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-24 18:24:50 +0200
committerAlan Pearce2024-05-24 18:24:50 +0200
commit2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5 (patch)
tree25d7e6038e893c1d39a7030f2f693f40a7e8c530 /internal/server/mux.go
parent042dadb9ee2c8ea32a8cda063732c0d0be62cec6 (diff)
downloadsearchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.tar.lz
searchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.tar.zst
searchix-2c1491de56d0c3e2f4cb0b0c1e33035510f72fc5.zip
fix: check for nil pointers in NewMux
Diffstat (limited to 'internal/server/mux.go')
-rw-r--r--internal/server/mux.go6
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,
 	})