diff options
author | Kim Alvefur <zash@zash.se> | 2017-05-14 17:31:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-05-14 17:31:50 +0200 |
commit | 6498b4bc296fd40e8958d836594d745656d37b41 (patch) | |
tree | 1f50b1484c2e950ab716d27a51ea8fe5cd068541 /plugins/mod_storage_internal.lua | |
parent | 2c41509285a4d440894a0421614bc9fee0178cbf (diff) | |
download | prosody-6498b4bc296fd40e8958d836594d745656d37b41.tar.gz prosody-6498b4bc296fd40e8958d836594d745656d37b41.zip |
mod_storage_internal: Handle case of empty item store when deleting (fixes #910)
Diffstat (limited to 'plugins/mod_storage_internal.lua')
-rw-r--r-- | plugins/mod_storage_internal.lua | 8 |
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) |