summaryrefslogtreecommitdiff
path: root/src/client/model
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-12-23 17:08:13 +0200
committerAlon Levy <alon@pobox.com>2014-12-23 17:08:13 +0200
commit03f0dd6d31967b7120a4fd8e841f5c23979f793d (patch)
treed1ee840ef9c897439c624196a7ce438e8c7d7e01 /src/client/model
parentc377c9a846e94ae5598f19af13e61517350c612d (diff)
client/model/graph/removeNode: complain early on unknown id
Diffstat (limited to 'src/client/model')
-rw-r--r--src/client/model/graph.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/model/graph.js b/src/client/model/graph.js
index 9d178636..26bf96b2 100644
--- a/src/client/model/graph.js
+++ b/src/client/model/graph.js
@@ -148,6 +148,10 @@ function Graph() {
this.removeNode = function(id) {
var n = find_node__by_id(id);
+ if (n === undefined) {
+ console.log('bug: nonexistent node cannot be removed: ' + id);
+ return;
+ }
this._remove_node_set([n]);
}