From 72cf164c510bf24045039b8a334ce044c4a08b2b 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 38818e83d6..1400bbdcc8 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -248,7 +248,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