projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
util.pubsub: Check whether node exists, when deleting
[prosody.git]
/
util
/
pubsub.lua
diff --git
a/util/pubsub.lua
b/util/pubsub.lua
index 1ecbdfa81df130b0177ee0fb9b273f82b3884bb8..e1418c62d51fdccf96b4f8605789ce0378e11a9e 100644
(file)
--- 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;