From cabc98fbadbe9ed9a72f5e9e18c7631b4217946b Mon Sep 17 00:00:00 2001 From: dklawren Date: Mon, 25 May 2020 16:52:20 -0400 Subject: [PATCH] Bug 1639903 - Fix `Use of uninitialized value in pattern match (m//) at /app/Bugzilla/App.pm line 71` --- Bugzilla/App.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bugzilla/App.pm b/Bugzilla/App.pm index 1e3e34108..003e7494c 100644 --- a/Bugzilla/App.pm +++ b/Bugzilla/App.pm @@ -68,7 +68,8 @@ sub startup { # If that is the case, we just log the error and continue on. try { my $regexp = Bugzilla->params->{block_user_agent}; - if ($regexp && $c->req->headers->user_agent =~ /$regexp/) { + my $user_agent = $c->req->headers->user_agent // ''; + if ($regexp && $user_agent =~ /$regexp/) { my $msg = "Contact " . Bugzilla->params->{maintainer}; $c->respond_to( json => {json => {error => $msg}, status => 400}, -- 2.47.3