Skip to content

Commit

Permalink
add missing validations
Browse files Browse the repository at this point in the history
fixes #7531
there were two validations that were missing in the c++ runtime but were not in Flutter

Diffs=
1e7b1c030 add missing validations (#7532)

Co-authored-by: hernan <[email protected]>
  • Loading branch information
bodymovin and bodymovin committed Jul 5, 2024
1 parent 716bb4d commit ca54937
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
07cbce5511e451396513f9d092a72193d41844f5
1e7b1c0301a9fb9404798d5b4c0e7175d199659e
13 changes: 9 additions & 4 deletions src/animation/animation_reset_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ class KeyedObjectData
auto pos = keyedPropertiesSet.find(keyedProperty->propertyKey());
if (pos == keyedPropertiesSet.end())
{
keyedPropertiesSet.insert(keyedProperty->propertyKey());
keyedPropertiesData.push_back(KeyedPropertyData(keyedProperty, isBaseline));
switch (CoreRegistry::propertyFieldId(keyedProperty->propertyKey()))
{
case CoreDoubleType::id:
case CoreColorType::id:
keyedPropertiesSet.insert(keyedProperty->propertyKey());
keyedPropertiesData.push_back(KeyedPropertyData(keyedProperty, isBaseline));
break;
}
}
index++;
}
Expand Down Expand Up @@ -66,7 +72,6 @@ class AnimationsData

void findKeyedObjects(const LinearAnimation* animation, bool isFirstAnimation)
{

size_t index = 0;
while (index < animation->numKeyedObjects())
{
Expand Down Expand Up @@ -169,7 +174,7 @@ void AnimationResetFactory::fromState(StateInstance* stateInstance,
if (stateInstance != nullptr)
{
auto state = stateInstance->state();
if (state->is<AnimationState>())
if (state->is<AnimationState>() && state->as<AnimationState>()->animation() != nullptr)
{
animations.push_back(state->as<AnimationState>()->animation());
}
Expand Down

0 comments on commit ca54937

Please sign in to comment.