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:
parent
40f28a1582
commit
c351beea56
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue