From 507a60abf6222c1c266bca54b7934407f9016ea4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 25 Aug 2020 11:38:32 +0200 Subject: [PATCH] Bug 23166: Early return if no set It prevents valid_template check to raise Can't call method "filter_by_current" without a package or object reference at /kohadevbox/koha/Koha/Template/Plugin/Context.pm line 49. --- Koha/Template/Plugin/Context.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Template/Plugin/Context.pm b/Koha/Template/Plugin/Context.pm index 3e5be2b3da..cccb346963 100644 --- a/Koha/Template/Plugin/Context.pm +++ b/Koha/Template/Plugin/Context.pm @@ -46,6 +46,7 @@ Return object set in scalar context sub Scalar { my ( $self, $set, $method ) = @_; + return unless $set; $set = $set->$method; return $set; } -- 2.20.1