From b7720c298bec0c385917bb53147d827abd71318f Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 19 Jul 2016 23:42:42 +0200 Subject: [PATCH] Error out if a template expansion returns nil (as it's normally an error). --- first/ackbuilder.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/first/ackbuilder.lua b/first/ackbuilder.lua index a799c8a4b..539b34897 100644 --- a/first/ackbuilder.lua +++ b/first/ackbuilder.lua @@ -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 -- 2.34.1