提交 52b76676 编写于 作者: W wangtiantian

add nullptr judgment

Change-Id: Ia41b6c0c8f4059a502bb7d13fb8b710e88b67191
上级 b45ef2ed
......@@ -143,13 +143,13 @@ void TypedText::GetArcLetterPos(const Point& arcCenter, uint16_t radius, float a
uint32_t TypedText::GetNextLine(const char* text, int16_t letterSpace, int16_t maxWidth)
{
uint32_t lastBreakPos = 0;
int16_t curW;
uint32_t index = 0;
uint32_t tmp = 0;
if (GetWrapPoint(text, index)) {
if ((text == nullptr) || GetWrapPoint(text, index)) {
return index;
}
uint32_t lastBreakPos = 0;
int16_t curW;
uint32_t tmp = 0;
while (true) {
curW = TypedText::GetTextWidth(text, index, letterSpace);
if (curW > maxWidth) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册