From ee968929591184b573739f42a67ff80fa63ec0fd Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 12 May 2023 06:56:07 +0000 Subject: [PATCH] Bug 33702: (QA follow-up) Do not crash on borrowernumber Resolve: Can't call method "borrowernumber" on an undefined value at /usr/share/koha/opac/opac-illrequests.pl line 66 Test plan: Put an unexisting illrequest_id in the URL parameter. You should see a 404, not a crash. Signed-off-by: Marcel de Rooy --- opac/opac-illrequests.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index c97f32b47a..d239126d46 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -63,7 +63,7 @@ my ( $illrequest_id, $request ); if ( $illrequest_id = $params->{illrequest_id} ) { $request = Koha::Illrequests->find($illrequest_id); # Make sure the request belongs to the logged in user - unless ( $request->borrowernumber == $loggedinuser ) { + if( !$request || $request->borrowernumber != $loggedinuser ) { print $query->redirect("/cgi-bin/koha/errors/404.pl"); exit; } -- 2.39.5