Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Bijkerk committed Jul 26, 2024
1 parent 550a3e3 commit 206fa89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/http/readiness/readiness.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (

func NewReadinessHandler(po *persistedoperations.Handler) http.HandlerFunc {

if po.Config().Enabled && po.Config().RejectOnFailure && po.PersistedOpsInMemory() == 0 {
if po != nil &&
po.Config().Enabled && po.Config().RejectOnFailure &&
po.PersistedOpsInMemory() == 0 {
return func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusServiceUnavailable)
_, _ = fmt.Fprintf(w, "Not ready yet!")
Expand Down

0 comments on commit 206fa89

Please sign in to comment.