mirror of https://github.com/axmolengine/axmol.git
fixed #248, crashed in CCSprite::setDisplayFrame
This commit is contained in:
parent
f3126de646
commit
5babcbca6b
|
@ -917,7 +917,8 @@ void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame)
|
||||||
|
|
||||||
CCTexture2D *pNewTexture = pNewFrame->getTexture();
|
CCTexture2D *pNewTexture = pNewFrame->getTexture();
|
||||||
// update texture before updating texture rect
|
// update texture before updating texture rect
|
||||||
if (pNewTexture->getName() != m_pobTexture->getName())
|
if (!m_pobTexture ||
|
||||||
|
pNewTexture->getName() != m_pobTexture->getName())
|
||||||
{
|
{
|
||||||
setTexture(pNewTexture);
|
setTexture(pNewTexture);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue