summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/template.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-06-19 14:49:48 +0200
committerJo-Philipp Wich <jo@mein.io>2020-06-19 14:51:49 +0200
commitc351beea561acafa088a3fd3d82bfec93ee45cd4 (patch)
tree7fd1a580d7ec300d820b855ce36f1cbf391ac9a9 /modules/luci-base/luasrc/template.lua
parent40f28a158278498ce9486916af259c67f1f8544e (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/luasrc/template.lua')
-rw-r--r--modules/luci-base/luasrc/template.lua2
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