diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-06-19 14:49:48 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-06-19 14:51:49 +0200 |
commit | c351beea561acafa088a3fd3d82bfec93ee45cd4 (patch) | |
tree | 7fd1a580d7ec300d820b855ce36f1cbf391ac9a9 /modules/luci-base | |
parent | 40f28a158278498ce9486916af259c67f1f8544e (diff) |
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>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/template.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |