From 6f341e3284433b9f9db9552b76cb7583822845a2 Mon Sep 17 00:00:00 2001 From: likexx Date: Mon, 13 Apr 2015 20:53:34 +0800 Subject: [PATCH] Update CCLabel.cpp in rare case, the texture atlas becomes NULL. Added an additional check to make sure it won't crash here. --- cocos/2d/CCLabel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 1354d8a1c7..4ea035b0c6 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -871,7 +871,7 @@ void Label::setFontScale(float fontScale) void Label::onDraw(const Mat4& transform, bool transformUpdated) { // Optimization: Fast Dispatch - if( _batchNodes.size() == 1 && _textureAtlas->getTotalQuads() == 0 ) + if( _textureAtlas == NULL || (_batchNodes.size() == 1 && _textureAtlas->getTotalQuads() == 0) ) { return; }