summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2014-01-16 21:12:33 +0000
committerKris <Kris.De.Gussem@hotmail.com>2014-01-16 21:12:33 +0000
commit4531eff8dbddaabfb1c67d7907879480a8fd7309 (patch)
treee72b33070926a6d21bc9ad076d0f2b6484ef061e /src
parentClean up sp-image's read_image, remove duplicate code (diff)
downloadinkscape-4531eff8dbddaabfb1c67d7907879480a8fd7309.tar.gz
inkscape-4531eff8dbddaabfb1c67d7907879480a8fd7309.zip
fix null pointer dereference
(bzr r12943)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tools/gradient-tool.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp
index e4ab7b424..10f78a8a8 100644
--- a/src/ui/tools/gradient-tool.cpp
+++ b/src/ui/tools/gradient-tool.cpp
@@ -339,10 +339,12 @@ sp_gradient_context_add_stops_between_selected_stops (GradientTool *rc)
SPGradient *gradient = getGradient(d->item, d->fill_or_stroke);
SPGradient *vector = sp_gradient_get_forked_vector_if_necessary (gradient, false);
SPStop *this_stop = sp_get_stop_i (vector, d->point_i);
- SPStop *next_stop = this_stop->getNextStop();
- if (this_stop && next_stop) {
- these_stops = g_slist_prepend (these_stops, this_stop);
- next_stops = g_slist_prepend (next_stops, next_stop);
+ if (this_stop) {
+ SPStop *next_stop = this_stop->getNextStop();
+ if (next_stop) {
+ these_stops = g_slist_prepend (these_stops, this_stop);
+ next_stops = g_slist_prepend (next_stops, next_stop);
+ }
}
}
}