Fix SVACE issue
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / linear-constrainer-impl.cpp
index 593e62b..41f6248 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,12 +119,15 @@ Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) c
   {
     Property::Value value( Property::ARRAY );
     Property::Array* array = value.GetArray();
-    DALI_ASSERT_DEBUG( array ); // should always exist in this case
     size_t count( mValue.Size() );
-    array->Reserve( count );
-    for( size_t i( 0 ); i != count; ++i )
+
+    if( array )
     {
-      array->PushBack( mValue[i] );
+      array->Reserve( count );
+      for( size_t i( 0 ); i != count; ++i )
+      {
+        array->PushBack( mValue[i] );
+      }
     }
     return value;
   }
@@ -132,12 +135,15 @@ Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) c
   {
     Property::Value value( Property::ARRAY );
     Property::Array* array = value.GetArray();
-    DALI_ASSERT_DEBUG( array ); // should always exist in this case
-    size_t count( mValue.Size() );
-    array->Reserve( count );
-    for( size_t i( 0 ); i != count; ++i )
+    size_t count( mProgress.Size() );
+
+    if( array )
     {
-      array->PushBack( mProgress[i] );
+      array->Reserve( count );
+      for( size_t i( 0 ); i != count; ++i )
+      {
+        array->PushBack( mProgress[i] );
+      }
     }
     return value;
   }
@@ -145,6 +151,11 @@ Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) c
   return Property::Value();
 }
 
+Property::Value LinearConstrainer::GetDefaultPropertyCurrentValue( Property::Index index ) const
+{
+  return GetDefaultProperty( index ); // Event-side only properties
+}
+
 void LinearConstrainer::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
 {
   const Property::Array* array = propertyValue.GetArray();