Error out if a template expansion returns nil (as it's normally an error).

This commit is contained in:
David Given 2016-07-19 23:42:42 +02:00
parent 2d2497c318
commit b7720c298b

View file

@ -256,7 +256,11 @@ local function templateexpand(list, vars)
if e then
error(string.format("error evaluating expression: %s", e))
end
return asstring(chunk())
local value = chunk()
if (value == nil) then
error(string.format("template expression expands to nil (probably an undefined variable)"))
end
return asstring(value)
end
)
end