diff options
author | Florian Zeitz <florob@babelmonkeys.de> | 2013-06-12 16:53:51 +0200 |
---|---|---|
committer | Florian Zeitz <florob@babelmonkeys.de> | 2013-06-12 16:53:51 +0200 |
commit | 81fdc0c7b697e969554ca3e8d44f118620908f11 (patch) | |
tree | bdf588bdd7214205177c7405eb9b48138ade9fb8 | |
parent | b4884d7aabd7a4a13cb02bea60c49ea2208a084b (diff) | |
download | prosody-81fdc0c7b697e969554ca3e8d44f118620908f11.tar.gz prosody-81fdc0c7b697e969554ca3e8d44f118620908f11.zip |
util.pubsub: Check whether node exists, when deleting
-rw-r--r-- | util/pubsub.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index 1ecbdfa8..e1418c62 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -233,6 +233,9 @@ function service:delete(node, actor) end -- local node_obj = self.nodes[node]; + if not node_obj then + return false, "item-not-found"; + end self.nodes[node] = nil; self.config.broadcaster("delete", node, node_obj.subscribers); return true; |