Author: Carlos Lopez <genet...@gmail.com>
Date:   Tue Aug  9 11:52:58 2011 +0200

Avoid crash when user exports a wplist and the bline connection is lost. Now if 
the user selects an exported WPList it won't add any duck

---

 synfig-studio/src/gui/duckmatic.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/synfig-studio/src/gui/duckmatic.cpp 
b/synfig-studio/src/gui/duckmatic.cpp
index 8ec5dd9..32a7cb7 100644
--- a/synfig-studio/src/gui/duckmatic.cpp
+++ b/synfig-studio/src/gui/duckmatic.cpp
@@ -2128,6 +2128,11 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& 
value_desc,etl::handle<Canva
                                error("expected a ValueNode_WPList");
                                assert(0);
                        }
+                       ValueNode::Handle bline(value_node->get_bline());
+                       // it is not possible to place any widthpoint's duck if 
there is
+                       // not associated bline.
+                       if(!bline)
+                               return false;
                        // Retrieve the homogeneous layer parameter
                        Layer::Handle layer_parent;
                        if(value_desc.parent_is_layer_param())
@@ -2161,9 +2166,8 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& 
value_desc,etl::handle<Canva
                                        // The position by amount and the 
amount by position
                                        // has to be written considering the 
bline length too
                                        // optionally
-                                       const ValueBase 
bline((*value_node->get_bline())(get_time()));
                                        ValueNode_BLineCalcVertex::LooseHandle 
bline_calc_vertex(ValueNode_BLineCalcVertex::create(Vector(0,0)));
-                                       bline_calc_vertex->set_link("bline", 
value_node->get_bline());
+                                       bline_calc_vertex->set_link("bline", 
bline);
                                        bline_calc_vertex->set_link("loop", 
ValueNode_Const::create(value_node->get_loop()));
                                        bline_calc_vertex->set_link("amount", 
ValueNode_Const::create(width_point.get_position()));
                                        
bline_calc_vertex->set_link("homogeneous", 
ValueNode_Const::create(homogeneous));


------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to