aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-07-05 05:44:56 +0200
committerKim Alvefur <zash@zash.se>2017-07-05 05:44:56 +0200
commitf1e0f5c8dd0fe96c8804161e16371305c9460d22 (patch)
tree8521fb326ff7dfb2cabf61ed7ba1ecb8b64cec46
parent0487f34a01ccb1a9736ad06cd3377d29067c689e (diff)
downloadprosody-f1e0f5c8dd0fe96c8804161e16371305c9460d22.tar.gz
prosody-f1e0f5c8dd0fe96c8804161e16371305c9460d22.zip
mod_storage_internal: Return a noop iterator if archive is empty (fixes #920)
-rw-r--r--plugins/mod_storage_internal.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index 0a382cee..76052575 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -62,7 +62,13 @@ end
function archive:find(username, query)
local items, err = datamanager.list_load(username, host, self.store);
- if not items then return items, err; end
+ if not items then
+ if err then
+ return items, err;
+ else
+ return function () end, 0;
+ end
+ end
local count = #items;
local i = 0;
if query then