From 3f2145c47781bd36e26d98e9003ef6406fc987a3 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 6 Mar 2016 18:51:11 +0100 Subject: storagemanager: Fix saving data in map shim when no prior data exists --- core/storagemanager.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'core/storagemanager.lua') 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; -- cgit v1.2.3