Partially fix 1689282: stops the crash when clicking in timetrack dialog
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 27 Mar 2007 15:12:12 +0000 (15:12 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 27 Mar 2007 15:12:12 +0000 (15:12 +0000)
git-svn-id: http://svn.voria.com/code@388 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/cellrenderer_timetrack.cpp

index 8a3f739..95a9d97 100644 (file)
@@ -158,6 +158,14 @@ bool get_closest_time(const synfig::Node::time_set &tset, const Time &t, const T
 {
        Node::time_set::const_iterator  i,j,end = tset.end();
 
+       // stop the crash mentioned in bug #1689282
+       // doesn't solve the underlying problem though, I don't think
+       if (tset.size() == 0)
+       {
+               synfig::error(__FILE__":%d: tset.size() == 0",__LINE__);
+               return false;
+       }
+
        //TODO add in RangeGet so it's not so damn hard to click on points
 
        i = tset.upper_bound(t); //where t is the lower bound, t < [first,i)