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 <m.de.rooy@rijksmuseum.nl>
This commit is contained in:
parent
ffad893252
commit
ee96892959
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue