diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index eea6d8776c..9a82f7c80a 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -917,7 +917,8 @@ void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame) CCTexture2D *pNewTexture = pNewFrame->getTexture(); // update texture before updating texture rect - if (pNewTexture->getName() != m_pobTexture->getName()) + if (!m_pobTexture || + pNewTexture->getName() != m_pobTexture->getName()) { setTexture(pNewTexture); }