aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2013-06-12 16:53:51 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2013-06-12 16:53:51 +0200
commit83a04db97f0e9ad24ea9c3db372cee4cf7954d89 (patch)
treebdf588bdd7214205177c7405eb9b48138ade9fb8 /util/pubsub.lua
parent9e8f445b666230317e51ec750c050e4b5f4e20fd (diff)
downloadprosody-83a04db97f0e9ad24ea9c3db372cee4cf7954d89.tar.gz
prosody-83a04db97f0e9ad24ea9c3db372cee4cf7954d89.zip
util.pubsub: Check whether node exists, when deleting
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r--util/pubsub.lua3
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;