diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-18 14:17:43 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-18 14:17:43 +0100 |
commit | 678f4c2c7836000e9a10c89e81b938f8d941c0c6 (patch) | |
tree | a21ea35414a2815009a972eef900be112d8819db | |
parent | e3daae729d23ed2514d313f38e37d4967460fdff (diff) | |
download | prosody-678f4c2c7836000e9a10c89e81b938f8d941c0c6.tar.gz prosody-678f4c2c7836000e9a10c89e81b938f8d941c0c6.zip |
util.pubsub: get_last_item(): Return error if node does not exist
-rw-r--r-- | util/pubsub.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index 628fdc59..72f7f5a7 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -597,6 +597,12 @@ function service:get_last_item(node, actor) return false, "forbidden"; end -- + + -- Check node exists + if not self.nodes[node] then + return false, "item-not-found"; + end + -- Returns success, id, item return true, self.data[node]:tail(); end |