mod_storage_xmlarchive: Assume offset to be zero if not included (thanks pep.)
authorKim Alvefur <zash@zash.se>
Sat, 04 Mar 2017 19:52:41 +0100
changeset 2599 307ddebb72e1
parent 2598 1e1c929c1aa5
child 2600 ffb6646b4253
mod_storage_xmlarchive: Assume offset to be zero if not included (thanks pep.)
mod_storage_xmlarchive/mod_storage_xmlarchive.lua
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Fri Mar 03 12:31:15 2017 +0000
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Sat Mar 04 19:52:41 2017 +0100
@@ -45,7 +45,7 @@
 	-- If the day-file is missing then we need to add it to the list of days
 	local first_of_day = not lfs.attributes(dm.getpath(username .. "@" .. day, module.host, self.store, "list"));
 
-	local offset = ok and err;
+	local offset = ok and err or 0;
 
 	local id = day .. "-" .. hmac_sha256(username.."@"..day.."+"..offset, data, true):sub(-16);
 	ok, err = dm.list_append(username.."@"..day, module.host, self.store, { id = id, when = dt.datetime(when), with = with, offset = offset, length = #data });