summaryrefslogtreecommitdiffstats
path: root/scene/animation/tween.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation/tween.cpp')
-rw-r--r--scene/animation/tween.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index 9d1118e0ef..e05c24ae09 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -489,6 +489,11 @@ Tween::Tween(bool p_valid) {
}
Ref<PropertyTweener> PropertyTweener::from(Variant p_value) {
+ ERR_FAIL_COND_V(tween.is_null(), nullptr);
+ if (!tween->_validate_type_match(p_value, final_val)) {
+ return nullptr;
+ }
+
initial_val = p_value;
do_continue = false;
return this;