From 992edc43b0c956c5f61259abfa36f0a256ad40d3 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=utf8 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ä Signed-off-by: Jonathan Druart --- 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.39.5