From 53fec846f81ac094c094a4173e30ee56ce7ec1a0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Jul 2021 08:59:25 +0000 Subject: [PATCH] Bug 26364: (QA follow-up) Do not crash on anonymous OPAC user Seriously! Can't call method "userid" on an undefined value at /usr/share/koha/Koha/Virtualshelf.pm line 253 Trivial fix. Signed-off-by: Marcel de Rooy https://bugs.koha-community.org/show_bug.cgi?id=26346 --- Koha/Virtualshelf.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index 4598b6f238..5f9b7bb153 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -241,7 +241,7 @@ sub can_be_managed { return 1 if $borrowernumber and $self->owner == $borrowernumber; - my $patron = Koha::Patrons->find( $borrowernumber ); + my $patron = Koha::Patrons->find( $borrowernumber ) or return 0; return 1 if $self->is_public and haspermission( $patron->userid, { lists => 'edit_public_lists' } ); return 0; -- 2.11.0