--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Thu Nov 24 01:15:08 2016 +0100
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Nov 25 23:08:18 2016 +0100
@@ -130,6 +130,10 @@
local q_with, q_start, q_end = query.with, query.start, query["end"];
for i = first_item, last_item, step do
local item = items[i];
+ if not item then
+ module:log("warn", "data[%q][%d] is nil", dates[d], i);
+ break;
+ end
local i_when, i_with = item.when, item.with;
if type(i_when) == "string" then
i_when = dt.parse(i_when);
@@ -138,10 +142,6 @@
module:log("warn", "data[%q][%d].when is invalid", dates[d], i);
break;
end
- if not item then
- module:log("warn", "data[%q][%d] is nil", dates[d], i);
- break;
- end
if xmlfile and in_range
and (not q_with or i_with == q_with)
and (not q_start or i_when >= q_start)