Update CCLabel.cpp

in rare case, the texture atlas becomes NULL. Added an additional check to make sure it won't crash here.
This commit is contained in:
likexx 2015-04-13 20:53:34 +08:00
parent bc34554bd9
commit 6f341e3284
1 changed files with 1 additions and 1 deletions

View File

@ -871,7 +871,7 @@ void Label::setFontScale(float fontScale)
void Label::onDraw(const Mat4& transform, bool transformUpdated) void Label::onDraw(const Mat4& transform, bool transformUpdated)
{ {
// Optimization: Fast Dispatch // Optimization: Fast Dispatch
if( _batchNodes.size() == 1 && _textureAtlas->getTotalQuads() == 0 ) if( _textureAtlas == NULL || (_batchNodes.size() == 1 && _textureAtlas->getTotalQuads() == 0) )
{ {
return; return;
} }