Mercurial > prosody-modules
changeset 3091:8e5da12205b5
mod_storage_memory: Fix removal of data in keyvalue (thanks jonasw)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Jun 2018 15:39:37 +0200 |
parents | 1d0925d008b2 |
children | 0f63e999d0e4 |
files | mod_storage_memory/mod_storage_memory.lua |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_storage_memory/mod_storage_memory.lua Sat Jun 02 03:13:13 2018 +0200 +++ b/mod_storage_memory/mod_storage_memory.lua Sat Jun 02 15:39:37 2018 +0200 @@ -29,7 +29,10 @@ end function keyval_store:set(username, data) - self.store[username or NULL] = envload("return "..serialize(data), "@data", {}); + if data ~= nil then + data = envload("return "..serialize(data), "@data", {}); + end + self.store[username or NULL] = data; return true; end