summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 57580f5)
raw | patch | inline | side by side (parent: 57580f5)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 8 Jan 2007 08:37:14 +0000 (08:37 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 8 Jan 2007 08:37:14 +0000 (08:37 +0000) |
src/nodepath.cpp | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 8371c8241825d00a153c1305b2de858b44c75a0a..be0a2eb1e28524860aba9d96e656af737920b098 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
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 <b>two endnodes</b> selected."));
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 <b>two endnodes</b> selected."));