From e8634c3ba23f098fd21f6f3cd9389db26b5842f6 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 5 Jan 2015 14:14:22 +0200 Subject: client/model/graph: add assert on update_node ajax success entry conditions --- src/client/model/graph.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/client/model/graph.js b/src/client/model/graph.js index 06ca2fdd..4350c664 100644 --- a/src/client/model/graph.js +++ b/src/client/model/graph.js @@ -452,6 +452,9 @@ function Graph(spec) { var on_ajax_success = function(id_to_node_map){ var node_id = node.id; // original node id + + util.assert(id_to_node_map && id_to_node_map[node_id], "bad return value from ajax"); + if (id_to_node_map[node_id].id != node_id){ // TODO: handle incoming ID update util.assert(false, 'update_node: id attr change'); -- cgit v1.3.1