Software / code / prosody
Comparison
plugins/mod_storage_internal.lua @ 8173:3ff99d49082f
mod_storage_internal: Return a noop iterator if archive is empty (fixes #920)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 05 Jul 2017 05:44:56 +0200 |
| parent | 8143:c4c159953c72 |
| child | 8309:5281c479955a |
comparison
equal
deleted
inserted
replaced
| 8172:66e32c34250b | 8173:3ff99d49082f |
|---|---|
| 60 return key; | 60 return key; |
| 61 end | 61 end |
| 62 | 62 |
| 63 function archive:find(username, query) | 63 function archive:find(username, query) |
| 64 local items, err = datamanager.list_load(username, host, self.store); | 64 local items, err = datamanager.list_load(username, host, self.store); |
| 65 if not items then return items, err; end | 65 if not items then |
| 66 if err then | |
| 67 return items, err; | |
| 68 else | |
| 69 return function () end, 0; | |
| 70 end | |
| 71 end | |
| 66 local count = #items; | 72 local count = #items; |
| 67 local i = 0; | 73 local i = 0; |
| 68 if query then | 74 if query then |
| 69 items = array(items); | 75 items = array(items); |
| 70 if query.key then | 76 if query.key then |