summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2006-08-05 14:19:39 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2006-08-05 14:19:39 +0000
commitcd624cd78f67a80b8aed4645a6f3a2a0535876f4 (patch)
tree0641cacf12a2cc903e29ecd2c3cafd66d98d42fb /src/nodepath.cpp
parentfinalising session establishment (diff)
downloadinkscape-cd624cd78f67a80b8aed4645a6f3a2a0535876f4.tar.gz
inkscape-cd624cd78f67a80b8aed4645a6f3a2a0535876f4.zip
add checks to make sure given nodepath pointers are not null before working with them
(bzr r1560)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index d4aada20c..e3681f59a 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -479,6 +479,9 @@ static void update_repr_internal(Inkscape::NodePath::Path *np)
*/
void sp_nodepath_update_repr(Inkscape::NodePath::Path *np, const gchar *annotation)
{
+ //fixme: np can be NULL, so check before proceeding
+ g_return_if_fail(np != NULL);
+
if (np->livarot_path) {
delete np->livarot_path;
np->livarot_path = NULL;
@@ -1551,6 +1554,9 @@ sp_nodepath_select_segment_near_point(Inkscape::NodePath::Path *nodepath, NR::Po
//find segment to segment
Inkscape::NodePath::Node *e = sp_nodepath_get_node_by_index(position.piece);
+ //fixme: this can return NULL, so check before proceeding.
+ g_return_if_fail(e != NULL);
+
gboolean force = FALSE;
if (!(e->selected && (!e->p.other || e->p.other->selected))) {
force = TRUE;
@@ -1604,6 +1610,10 @@ sp_nodepath_add_node_near_point(Inkscape::NodePath::Path *nodepath, NR::Point p)
void
sp_nodepath_curve_drag(Inkscape::NodePath::Node * e, double t, NR::Point delta)
{
+ //fixme: e and e->p can be NULL, so check for those before proceeding
+ g_return_if_fail(e != NULL);
+ g_return_if_fail(&e->p != NULL);
+
/* feel good is an arbitrary parameter that distributes the delta between handles
* if t of the drag point is less than 1/6 distance form the endpoint only
* the corresponding hadle is adjusted. This matches the behavior in GIMP