aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/anubis/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go
index 683fd7a..de0a592 100644
--- a/cmd/anubis/main.go
+++ b/cmd/anubis/main.go
@@ -287,6 +287,11 @@ func (s *Server) maybeReverseProxy(w http.ResponseWriter, r *http.Request) {
case config.RuleDeny:
clearCookie(w)
lg.Info("explicit deny")
+ if rule == nil {
+ lg.Error("rule is nil, cannot calculate checksum")
+ templ.Handler(base("Oh noes!", errorPage("Other internal server error (contact the admin)")), templ.WithStatus(http.StatusInternalServerError)).ServeHTTP(w, r)
+ return
+ }
hash, err := rule.Hash()
if err != nil {
lg.Error("can't calculate checksum of rule", "err", err)