From: dooglus Date: Fri, 23 Mar 2007 15:46:54 +0000 (+0000) Subject: Deleting all the verticies from a Curve Gradient used to cause a crash. This stops... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0a4abd7cb1c8b8010a16bbe78befadb9f5960ae1;p=synfig.git 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 --- 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)