From f23226fb73c9e9ba0a0b05be8047c9f67c848284 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 Content-Type: text/plain; charset=utf-8 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 --- Koha/Virtualshelf.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index 66ae4beb68..676791ff02 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -249,7 +249,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.20.1