Never: write nil to file

This commit is contained in:
Coder12a 2019-05-19 22:21:21 -05:00
parent 19b6648d69
commit e953987c9c

View File

@ -100,6 +100,9 @@ function colddb.Colddb(dir)
local function save_table(name, _table)
minetest.log(string.format("%s/%s.cold", directory, name))
if save_table == nil or name == nil then
return false
end
return minetest.safe_file_write(string.format("%s/%s.cold", directory, name), minetest.serialize(_table))
end