Fix prevent issue - animatableProperty might be null 18/40918/3
authorYoonsang Lee <ysang114.lee@samsung.com>
Wed, 10 Jun 2015 08:21:49 +0000 (17:21 +0900)
committerYoonsang Lee <ysang114.lee@samsung.com>
Thu, 11 Jun 2015 00:24:12 +0000 (09:24 +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 d09d502cbb6c25ce8f99a998c02f83d0ed984091..4db4ebdf09671af67adcd9aa932cfbb7a1ad489c 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.