aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-03-06 18:51:11 +0100
committerKim Alvefur <zash@zash.se>2016-03-06 18:51:11 +0100
commit3f2145c47781bd36e26d98e9003ef6406fc987a3 (patch)
tree340fe00e49001c4f72bfd9218d140a183ada6eca /core/storagemanager.lua
parentc933d017d7cae2c2b8a00330079e8f10d96aa778 (diff)
downloadprosody-3f2145c47781bd36e26d98e9003ef6406fc987a3.tar.gz
prosody-3f2145c47781bd36e26d98e9003ef6406fc987a3.zip
storagemanager: Fix saving data in map shim when no prior data exists
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 4f04e594..680b65ad 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -123,14 +123,12 @@ local map_shim_mt = {
if current == nil then
if err then
return nil, err;
- else
- current = keydatas;
- end
- else
- for k,v in pairs(keydatas) do
- if v == self.remove then v = nil; end
- current[k] = v;
end
+ current = {};
+ end
+ for k,v in pairs(keydatas) do
+ if v == self.remove then v = nil; end
+ current[k] = v;
end
return self.keyval_store:set(username, current);
end;