Fix svace : assert when we fail to register animatable properties 06/307006/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Sun, 3 Mar 2024 23:57:12 +0000 (08:57 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Sun, 3 Mar 2024 23:57:50 +0000 (08:57 +0900)
Change-Id: I8eccee3b241e0fbff509eab4c03a75466d33259f
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/event/common/object-impl.cpp

index 8859047..d5cb12e 100644 (file)
@@ -1222,12 +1222,15 @@ AnimatablePropertyMetadata* Object::GetSceneAnimatableProperty(Property::Index i
         {
           // If the base property is not registered yet, register the base property first.
           RegisterAnimatableProperty(*typeInfo, basePropertyIndex, value);
+          DALI_ASSERT_ALWAYS(mAnimatableProperties.Size() > 0u && "Something wrong when we regiser animatable base property!");
+
           animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size() - 1]);
         }
 
         // Create the metadata for the property component.
         mAnimatableProperties.PushBack(new AnimatablePropertyMetadata(index, typeInfo->GetComponentIndex(index), animatableProperty->value, animatableProperty->GetSceneGraphProperty()));
       }
+      DALI_ASSERT_ALWAYS(mAnimatableProperties.Size() > 0u && "Something wrong when we regiser new animatable property!");
 
       // The metadata has just been added and therefore should be in the end of the vector.
       animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size() - 1]);