summaryrefslogtreecommitdiff
path: root/src/ws
diff options
context:
space:
mode:
Diffstat (limited to 'src/ws')
-rw-r--r--src/ws/handler.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ws/handler.js b/src/ws/handler.js
index 5bb7892..eff5a07 100644
--- a/src/ws/handler.js
+++ b/src/ws/handler.js
@@ -26,9 +26,14 @@ function removeEventHandler(e)
var id = e.detail.id;
var node = findNode(id, subscribeid);
+ if(node == null)
+ {
+ return; // Node not present - don't do anything
+ }
if(node.id == node.subscribeid)
{
removeBoard(subscribeid);
+ nodes.splice(nodes.indexOf(node), 1);
}
if(node.parent)
@@ -61,6 +66,11 @@ function createEventHandler(e)
var parentid = e.detail.parentid;
var insertBeforeId = e.detail.insertBeforeId;
+ if(findNode(id, subscribeid) != null)
+ {
+ return; // node already exists
+ }
+
var node = new Node(id, subscribeid);
node.create();