bug in CCAnimation

bug in CCAnimation
0.0 0


The next code snippet crashes:
frames = CCAnimation::animationWithName(“frames”);
sprite->setDisplayFrame(“frames”, 0);

Platform: win32


The bugfix should be pretty easy (my code is underlined):
void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame)
if (! m_pobTexture || (pNewTexture~~>getName != m_pobTexture~~>getName()))


Thanks! I fixed this bug following your suggesion.
see the commit https://github.com/cocos2d/cocos2d-x/commit/07d66c1919c6f13b76ca044b99a66dd9512ffc9f
Another developer report this bug in this morning, too.

That’s the different between c*+ and objc. In objc call a nil.method is safe, but in c*+ it will crash as this bug. I was not careful enough :slight_smile: