From 1bde1d5cc89efba77db4178af253ce88f2ae667d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 4 Dec 2019 13:07:43 -0500 Subject: [PATCH] Bug 20256: (QA follow-up) Handle non-existing userenv Signed-off-by: Bob Bennhoff - CLiC Signed-off-by: Martin Renvoize --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 4b7617281fd..efb1257db5b 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1409,7 +1409,7 @@ sub can_edit_item { return 1 if C4::Context->IsSuperLibrarian(); - if ( C4::Context->preference('IndependentBranches') ) { + if ( $userenv && C4::Context->preference('IndependentBranches') ) { return $userenv->{branch} eq $branchcode; } -- 2.30.2