Skip to content

Commit 416198e

Browse files
committed
guard against nil input param
1 parent 42d6fa1 commit 416198e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

http/api/api.go

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ func setupCtxLog(ctx context.Context, ids []string, logger log.Logger) (context.
8080
// note we expose Go errors to the output as this is meant for "API"
8181
// users.
8282
func PushHandler(pusher push.Pusher, logger log.Logger) http.HandlerFunc {
83+
if pusher == nil {
84+
panic("nil pusher")
85+
}
8386
return func(w http.ResponseWriter, r *http.Request) {
8487
ids := strings.Split(r.URL.Path, ",")
8588
ctx, logger := setupCtxLog(r.Context(), ids, logger)

0 commit comments

Comments
 (0)