add check for empty string on file writing

This commit is contained in:
gabryon99 2020-09-28 15:23:55 +02:00
parent 5a62f4553f
commit 06480d3171

View file

@ -52,6 +52,11 @@ function file_utils.copy_file(fname, src_path, dst_path)
return(false)
end
if (instr == nil) then
traceError(TRACE_ERROR, TRACE_CONSOLE, string.format("Could not write the string into file %s", dst))
return (false)
end
outfile:write(instr)
outfile:close()