Fixed crash in case that overshoot scroll is not enabled 37/37737/1
authorJonghyun Ho <jonghyun.ho@samsung.com>
Fri, 3 Apr 2015 07:18:35 +0000 (16:18 +0900)
committerJonghyun Ho <jonghyun.ho@samsung.com>
Fri, 3 Apr 2015 07:20:04 +0000 (16:20 +0900)
Change-Id: I4e92daaa51cdcb1d4ac61b5093ff7bdda5a9024d

dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp

index 9ac90b91f6a44a9d48f8e656797e43085d5050ad..43f134d83b3edbd5aea8f9ac0d297a9ab139f6b3 100644 (file)
@@ -1638,7 +1638,12 @@ void ItemView::AnimateScrollOvershoot(float overshootAmount, bool animateBack)
   if(mOvershootAnimationSpeed > Math::MACHINE_EPSILON_0)
   {
     float currentOvershoot = mScrollPositionObject.GetProperty<float>(ScrollConnector::OVERSHOOT);
-    float duration = mOvershootOverlay.GetCurrentSize().height * (animatingOn ? (1.0f - fabsf(currentOvershoot)) : fabsf(currentOvershoot)) / mOvershootAnimationSpeed;
+    float duration = 0.0f;
+
+    if (mOvershootOverlay)
+    {
+      duration = mOvershootOverlay.GetCurrentSize().height * (animatingOn ? (1.0f - fabsf(currentOvershoot)) : fabsf(currentOvershoot)) / mOvershootAnimationSpeed;
+    }
 
     RemoveAnimation(mScrollOvershootAnimation);
     mScrollOvershootAnimation = Animation::New(duration);