From c1fd88b13e6e9eff3860fe1bfb2bdb1358acf954 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Fri, 3 Jun 2016 16:46:25 +0800 Subject: [PATCH] fixed fromVal maybe null --- cocos2d/animation/animation-curves.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos2d/animation/animation-curves.js b/cocos2d/animation/animation-curves.js index a33a5f86ed..29e83971ac 100644 --- a/cocos2d/animation/animation-curves.js +++ b/cocos2d/animation/animation-curves.js @@ -104,8 +104,7 @@ var DynamicAnimCurve = cc.Class({ value = fromVal + (toVal - fromVal) * ratio; } else { - var lerp = fromVal.lerp; - if (lerp) { + if (fromVal && fromVal.lerp) { value = fromVal.lerp(toVal, ratio); } else {