From 04d52fd099de46112313d47ded426e56938686ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 5 Jul 2017 05:44:56 +0200 Subject: mod_storage_internal: Return a noop iterator if archive is empty (fixes #920) --- plugins/mod_storage_internal.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/mod_storage_internal.lua') 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 -- cgit v1.2.3