From e953987c9c6d3eadd8c1404e2e7bb957998ae1f6 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Sun, 19 May 2019 22:21:21 -0500 Subject: [PATCH] Never: write nil to file --- colddb.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/colddb.lua b/colddb.lua index a6cf88f..593a93e 100644 --- a/colddb.lua +++ b/colddb.lua @@ -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