Don't assume the value description is a linkable value node.
authorCarlos Lopez <genetita@gmail.com>
Wed, 13 Oct 2010 18:53:41 +0000 (20:53 +0200)
committerCarlos Lopez <genetita@gmail.com>
Wed, 13 Oct 2010 18:53:41 +0000 (20:53 +0200)
Doing that produced assert(0) when linking regular layer parameters. Fixed with this commit.

synfig-studio/src/synfigapp/actions/valuedesclink.cpp

index 6afde69..a9959c1 100644 (file)
@@ -316,7 +316,9 @@ Action::ValueDescLink::prepare()
 
        std::list<ValueDesc>::iterator iter;
        // Gets the scalar value of the current value node
-       Real current_scalar(value_desc_list.begin()->get_scalar());
+       Real current_scalar(0);
+       if(value_desc_list.begin()->parent_is_linkable_value_node())
+               current_scalar=value_desc_list.begin()->get_scalar();
        bool found_inverse(false);
        // Check if we are dealing the case of linking differnt types of tangents
        for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)