From 12f0f7f580f8413ebe7513a7c714381b389cefb1 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 14 Sep 2015 17:36:19 +0800 Subject: [PATCH] Fix 1.6 version bone animation crash when perform getBoneAtPoint(0,0) --- cocos/editor-support/cocostudio/CCDisplayManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index b294572549..5a749f68d4 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -383,10 +383,12 @@ bool DisplayManager::containPoint(Vec2 &point) Vec2 outPoint; Sprite *sprite = (Sprite *)_currentDecoDisplay->getDisplay(); - sprite = (Sprite *)sprite->getChildByTag(0); - - ret = CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint); + Sprite *child = (Sprite *)sprite->getChildByTag(0); + if(nullptr != child) + sprite = child; + if (nullptr != sprite) + ret = CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint); } break;