# HG changeset patch # User Kim Alvefur # Date 1499226296 -7200 # Node ID 3ff99d49082f7255033bacebb02e5090426f9d75 # Parent 66e32c34250b7406a182ca54dbf3408fcb260e1e mod_storage_internal: Return a noop iterator if archive is empty (fixes #920) diff -r 66e32c34250b -r 3ff99d49082f plugins/mod_storage_internal.lua --- a/plugins/mod_storage_internal.lua Wed Jul 05 04:38:08 2017 +0200 +++ b/plugins/mod_storage_internal.lua Wed Jul 05 05:44:56 2017 +0200 @@ -62,7 +62,13 @@ 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