Software /
code /
prosody
Changeset
5675:e29ece65e3b0
util.pubsub: Check whether node exists, when deleting
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Wed, 12 Jun 2013 16:53:51 +0200 |
parents | 5673:9ca4d1ada906 |
children | 5676:c1021a2e7071 |
files | util/pubsub.lua |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/pubsub.lua Tue Jun 11 21:44:53 2013 +0100 +++ b/util/pubsub.lua Wed Jun 12 16:53:51 2013 +0200 @@ -233,6 +233,9 @@ 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;