From 83a04db97f0e9ad24ea9c3db372cee4cf7954d89 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 12 Jun 2013 16:53:51 +0200 Subject: util.pubsub: Check whether node exists, when deleting --- util/pubsub.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/pubsub.lua') 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; -- cgit v1.2.3