Changed lume.format() to abort early if vars is nil

This commit is contained in:
rxi 2014-03-03 21:08:19 +00:00
parent 8283410210
commit 97907d5d13

View File

@ -231,7 +231,7 @@ end
function lume.format(str, vars) function lume.format(str, vars)
vars = vars or {} if not vars then return str end
local f = function(x) return tostring(vars[x] or "{" .. x .. "}") end local f = function(x) return tostring(vars[x] or "{" .. x .. "}") end
return (str:gsub("{(.-)}", f)) return (str:gsub("{(.-)}", f))
end end