diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-18 14:21:02 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-18 14:21:02 +0100 |
commit | 2282b01839e2b2bf1c92bef7424d6582ecb994c9 (patch) | |
tree | 960d77fa23a97ad11755f8ca53ed1f793ccd01d1 /util/pubsub.lua | |
parent | 678f4c2c7836000e9a10c89e81b938f8d941c0c6 (diff) | |
download | prosody-2282b01839e2b2bf1c92bef7424d6582ecb994c9.tar.gz prosody-2282b01839e2b2bf1c92bef7424d6582ecb994c9.zip |
util.pubsub: get_last_item(): Fail with item-not-found if no item yet published
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r-- | util/pubsub.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index 72f7f5a7..ca6dca20 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -598,8 +598,8 @@ function service:get_last_item(node, actor) end -- - -- Check node exists - if not self.nodes[node] then + -- Check node exists and has an item published + if not (self.nodes[node] and self.data[node]) then return false, "item-not-found"; end |