From ec3f38afbebe6ba3131714b0b6f58a47d519f03e Mon Sep 17 00:00:00 2001 From: bulia byak Date: Mon, 8 Jan 2007 08:37:14 +0000 Subject: fix 1630193 (bzr r2156) --- src/nodepath.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/nodepath.cpp') diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 8371c8241..be0a2eb1e 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -1727,8 +1727,11 @@ void sp_node_selected_join() Inkscape::NodePath::Node *b = (Inkscape::NodePath::Node *) nodepath->selected->next->data; g_assert(a != b); - g_assert(a->p.other || a->n.other); - g_assert(b->p.other || b->n.other); + if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { + // someone tried to join an orphan node (i.e. a single-node subpath). + // this is not worth an error message, just fail silently. + return; + } if (((a->subpath->closed) || (b->subpath->closed)) || (a->p.other && a->n.other) || (b->p.other && b->n.other)) { nodepath->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("To join, you must have two endnodes selected.")); @@ -1826,8 +1829,11 @@ void sp_node_selected_join_segment() Inkscape::NodePath::Node *b = (Inkscape::NodePath::Node *) nodepath->selected->next->data; g_assert(a != b); - g_assert(a->p.other || a->n.other); - g_assert(b->p.other || b->n.other); + if (!(a->p.other || a->n.other) || !(b->p.other || b->n.other)) { + // someone tried to join an orphan node (i.e. a single-node subpath). + // this is not worth an error message, just fail silently. + return; + } if (((a->subpath->closed) || (b->subpath->closed)) || (a->p.other && a->n.other) || (b->p.other && b->n.other)) { nodepath->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("To join, you must have two endnodes selected.")); -- cgit v1.2.3