diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-23 17:08:13 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-23 17:08:13 +0200 |
| commit | 03f0dd6d31967b7120a4fd8e841f5c23979f793d (patch) | |
| tree | d1ee840ef9c897439c624196a7ce438e8c7d7e01 /src | |
| parent | c377c9a846e94ae5598f19af13e61517350c612d (diff) | |
client/model/graph/removeNode: complain early on unknown id
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/model/graph.js | 4 |
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]); } |
