From 0a4abd7cb1c8b8010a16bbe78befadb9f5960ae1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 23 Mar 2007 15:46:54 +0000 Subject: [PATCH] Deleting all the verticies from a Curve Gradient used to cause a crash. This stops the crash. Perhaps a better fix would be to prevent the user ever deleting the last vertex in any bline, but maybe zero-length blines serve some purpose. git-svn-id: http://svn.voria.com/code@372 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp index 8013b7d..b98caa6 100644 --- a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp +++ b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp @@ -77,6 +77,8 @@ inline float calculate_distance(const std::vector& bline) float dist(0); + if (bline.empty()) return dist; + next=bline.begin(); //if(loop) -- 2.7.4