From: dklawren Date: Mon, 25 May 2020 20:52:20 +0000 (-0400) Subject: Bug 1639903 - Fix `Use of uninitialized value in pattern match (m//) at /app/Bugzilla... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cabc98fbadbe9ed9a72f5e9e18c7631b4217946b;p=thirdparty%2Fbugzilla.git Bug 1639903 - Fix `Use of uninitialized value in pattern match (m//) at /app/Bugzilla/App.pm line 71` --- 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},