mirror of https://github.com/axmolengine/axmol.git
check if _currentUTF16String is null
This commit is contained in:
parent
9cf463bf6a
commit
8f14597717
|
@ -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);
|
||||
|
|
|
@ -571,7 +571,7 @@ float Label::getScaleX() const
|
|||
|
||||
void Label::alignText()
|
||||
{
|
||||
if (_fontAtlas == nullptr)
|
||||
if (_fontAtlas == nullptr || _currentUTF16String == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue