aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/datamanager.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 9d3c8592..f67c8864 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -102,7 +102,8 @@ function store(username, host, datastore, data)
f:write("return ");
append(f, data);
f:close();
- if not next(data) then -- try to delete empty datastore
+ if next(data) == nil then -- try to delete empty datastore
+ log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host);
os_remove(getpath(username, host, datastore));
end
-- we write data even when we are deleting because lua doesn't have a
@@ -141,7 +142,8 @@ function list_store(username, host, datastore, data)
f:write(");\n");
end
f:close();
- if not next(data) then -- try to delete empty datastore
+ if next(data) == nil then -- try to delete empty datastore
+ log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host);
os_remove(getpath(username, host, datastore, "list"));
end
-- we write data even when we are deleting because lua doesn't have a