Handle token.to_string returning nil for empty

This commit is contained in:
Marcel Krüger 2020-08-25 00:20:23 +02:00
parent 3579605228
commit 10add04b91

View File

@ -135,7 +135,8 @@ token.luacmd("closein", function(_, prefix)
end, "value")
local function do_write(p)
local content = token.to_string(p.data) .. '\n'
local data = token.to_string(p.data)
local content = data and data .. '\n' or '\n'
local file = ofiles[p.file]
if file then
file:write(content)