mirror of
https://github.com/openwrt/luci.git
synced 2026-06-17 17:03:20 +04:00
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 <jo@mein.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user