projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check that a ValueNode is compatible with the given type before attempting to create it.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
valuenode.cpp
diff --git
a/synfig-core/trunk/src/synfig/valuenode.cpp
b/synfig-core/trunk/src/synfig/valuenode.cpp
index
81a9fa2
..
2539e5b
100644
(file)
--- a/
synfig-core/trunk/src/synfig/valuenode.cpp
+++ b/
synfig-core/trunk/src/synfig/valuenode.cpp
@@
-201,6
+201,13
@@
LinkableValueNode::create(const String &name, const ValueBase& x)
{
if(!book().count(name))
return 0;
{
if(!book().count(name))
return 0;
+
+ if (!check_type(name, x.get_type()))
+ {
+ error(_("Bad type: ValueNode '%s' doesn't accept type '%s'"), book()[name].local_name.c_str(), ValueBase::type_local_name(x.get_type()).c_str());
+ return 0;
+ }
+
return book()[name].factory(x);
}
return book()[name].factory(x);
}