check if _currentUTF16String is null

This commit is contained in:
Dale Stammen 2014-04-19 09:38:45 -07:00
parent 9cf463bf6a
commit 8f14597717
2 changed files with 2 additions and 2 deletions

View File

@ -221,7 +221,7 @@ bool FontAtlas::getLetterDefinitionForChar(unsigned short letteCharUTF16, FontL
bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String)
{
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
if(fontTTf == nullptr)
if(fontTTf == nullptr || utf16String == nullptr)
return false;
int length = cc_wcslen(utf16String);

View File

@ -571,7 +571,7 @@ float Label::getScaleX() const
void Label::alignText()
{
if (_fontAtlas == nullptr)
if (_fontAtlas == nullptr || _currentUTF16String == nullptr)
{
return;
}