Add check for whether the Renderer has been created.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-base-impl.cpp
index 064b13d..3dad561 100755 (executable)
@@ -699,17 +699,20 @@ void Visual::Base::SetupBlendMode( Animation& transition, bool isInitialOpaque,
   // turned off after the animation ends if the final value is opaque
   if( ! isInitialOpaque || mImpl->mMixColor.a < 1.0f )
   {
-    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
-
-    if( animating == true && mImpl->mMixColor.a >= 1.0f )
+    if( mImpl->mRenderer )
     {
-      // When it becomes opaque, set the blend mode back to automatically
-      if( ! mImpl->mBlendSlotDelegate )
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+
+      if( animating == true && mImpl->mMixColor.a >= 1.0f )
       {
-        mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
+        // When it becomes opaque, set the blend mode back to automatically
+        if( ! mImpl->mBlendSlotDelegate )
+        {
+          mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
+        }
+        transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
+                                             &Visual::Base::OnMixColorFinished );
       }
-      transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
-                                           &Visual::Base::OnMixColorFinished );
     }
   }
 }