Fix Svace issue 43/76943/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Jun 2016 04:53:07 +0000 (13:53 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Jun 2016 05:31:03 +0000 (14:31 +0900)
- Return value of a function GetArray() has to be checked for NULL at gradient-renderer.cpp

Change-Id: I32ec6c5de941b19d510b2aa35aa06a10d7314dc6

dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp

index c150497..637dd6b 100644 (file)
@@ -460,13 +460,16 @@ void GradientRenderer::GetStopOffsets(const Property::Value* value, Vector<float
       case Property::ARRAY:
       {
         Property::Array* offsetArray = value->GetArray();
-        unsigned int numStop = offsetArray->Count();
-        float offset;
-        for( unsigned int i=0; i<numStop; i++ )
+        if( offsetArray )
         {
-          if( offsetArray->GetElementAt(i).Get(offset) )
+          unsigned int numStop = offsetArray->Count();
+          float offset;
+          for( unsigned int i=0; i<numStop; i++ )
           {
-            stopOffsets.PushBack( offset );
+            if( offsetArray->GetElementAt(i).Get(offset) )
+            {
+              stopOffsets.PushBack( offset );
+            }
           }
         }
         break;