Skip to content

Commit

Permalink
Merge pull request #52925 from timothyqiu/follow-property-null
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Sep 22, 2021
2 parents 644b054 + 45b4304 commit 23bb588
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scene/animation/tween.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,10 @@ bool Tween::follow_property(Object *p_object, NodePath p_property, Variant p_ini
return true;
}

// Confirm the source and target objects are valid
ERR_FAIL_NULL_V(p_object, false);
ERR_FAIL_NULL_V(p_target, false);

// Get the two properties from their paths
p_property = p_property.get_as_property_path();
p_target_property = p_target_property.get_as_property_path();
Expand All @@ -1569,10 +1573,6 @@ bool Tween::follow_property(Object *p_object, NodePath p_property, Variant p_ini
p_initial_val = p_initial_val.operator real_t();
}

// Confirm the source and target objects are valid
ERR_FAIL_COND_V(p_object == nullptr, false);
ERR_FAIL_COND_V(p_target == nullptr, false);

// No negative durations
ERR_FAIL_COND_V(p_duration < 0, false);

Expand Down

0 comments on commit 23bb588

Please sign in to comment.