From c351beea561acafa088a3fd3d82bfec93ee45cd4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 19 Jun 2020 14:49:48 +0200 Subject: luci-base: template.lua: fix nil access in string template error handling Template strings have no associated name, which led to an attempt to concat nil with a string when formatting the error message in case of exceptions. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/template.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-base/luasrc/template.lua') diff --git a/modules/luci-base/luasrc/template.lua b/modules/luci-base/luasrc/template.lua index ed46f50753..cd9b73b22b 100644 --- a/modules/luci-base/luasrc/template.lua +++ b/modules/luci-base/luasrc/template.lua @@ -71,7 +71,7 @@ function Template.__init__(self, name, template) -- If we have no valid template throw error, otherwise cache the template if not self.template then - error("Failed to load template '" .. name .. "'.\n" .. + error("Failed to load template '" .. self.name .. "'.\n" .. "Error while parsing template '" .. sourcefile .. "':\n" .. (err or "Unknown syntax error")) elseif name then -- cgit v1.2.3