aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-18 14:21:02 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-18 14:21:02 +0100
commit2282b01839e2b2bf1c92bef7424d6582ecb994c9 (patch)
tree960d77fa23a97ad11755f8ca53ed1f793ccd01d1 /util/pubsub.lua
parent678f4c2c7836000e9a10c89e81b938f8d941c0c6 (diff)
downloadprosody-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.lua4
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