aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-05-14 17:31:50 +0200
committerKim Alvefur <zash@zash.se>2017-05-14 17:31:50 +0200
commitd7789712dab1431eafbf00a8f3bb68e45738bc86 (patch)
tree1f50b1484c2e950ab716d27a51ea8fe5cd068541 /plugins
parent83741da83af1f361605aeba6f3c884fcfa5fc755 (diff)
downloadprosody-d7789712dab1431eafbf00a8f3bb68e45738bc86.tar.gz
prosody-d7789712dab1431eafbf00a8f3bb68e45738bc86.zip
mod_storage_internal: Handle case of empty item store when deleting (fixes #910)
Diffstat (limited to 'plugins')
-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 94d73af7..0a382cee 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -139,7 +139,13 @@ function archive:delete(username, query)
if k ~= "end" then return nil, "unsupported-query-field"; end
end
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;
+ end
+ -- Store is empty
+ return 0;
+ end
items = array(items);
local count_before = #items;
items:filter(function (item)