aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit6ff958994e268f1a1ba5b263ae4eabbbc1b4daeb (patch)
tree960d77fa23a97ad11755f8ca53ed1f793ccd01d1 /util
parent6643aeb7e69f9ec75687fae9d9fd1434213645f3 (diff)
downloadprosody-6ff958994e268f1a1ba5b263ae4eabbbc1b4daeb.tar.gz
prosody-6ff958994e268f1a1ba5b263ae4eabbbc1b4daeb.zip
util.pubsub: get_last_item(): Fail with item-not-found if no item yet published
Diffstat (limited to 'util')
-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