Fix prevent issue - animatableProperty might be null
authorYoonsang Lee <ysang114.lee@samsung.com>
Wed, 10 Jun 2015 08:21:49 +0000 (17:21 +0900)
committerYoonsang Lee <ysang114.lee@samsung.com>
Tue, 23 Jun 2015 02:23:02 +0000 (11:23 +0900)
- animatableProperty might be null, so move dereferencing code into the null
check block

<Prevent message>
8. var_compare_op: Comparing animatableProperty to null implies that animatableProperty might be null.
1235        if(!animatableProperty)

CID 385005 (#1 of 1): Dereference after null check (FORWARD_NULL)
10. var_deref_op: Dereferencing null pointer animatableProperty.
1245        mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->type, animatableProperty->GetSceneGraphProperty() ) );

Change-Id: Ibf6a6670e258b8729b86da80991e0a3ece64452e

dali/internal/event/common/object-impl.cpp

index d09d502..4db4ebd 100644 (file)
@@ -1241,8 +1241,11 @@ AnimatablePropertyMetadata* Object::RegisterAnimatableProperty(Property::Index i
           }
         }
 
-        // Create the metadata for the property component.
-        mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->type, animatableProperty->GetSceneGraphProperty() ) );
+        if(animatableProperty)
+        {
+          // Create the metadata for the property component.
+          mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->type, animatableProperty->GetSceneGraphProperty() ) );
+        }
       }
 
       // The metadata has just been added and therefore should be in the end of the vector.