# HG changeset patch # User Kim Alvefur # Date 1494775910 -7200 # Node ID c4c159953c7241d9c174cd60d923a6144c4875b0 # Parent 13e075549cb360de87ee02d9351d45f65ad40a57 mod_storage_internal: Handle case of empty item store when deleting (fixes #910) diff -r 13e075549cb3 -r c4c159953c72 plugins/mod_storage_internal.lua --- a/plugins/mod_storage_internal.lua Sun May 14 17:22:33 2017 +0200 +++ b/plugins/mod_storage_internal.lua Sun May 14 17:31:50 2017 +0200 @@ -139,7 +139,13 @@ 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)