From f3cd7c48d7e9f0a0d7232d291a4b6600e94fd05e 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Joonas Kylmälä --- 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.11.0