Hello!
There is a problem in file UITextList: there is no check for Null (emptyness). As a result, we are having errors in Rebuild() and UpdateVisibleText().
Details:
// Recalculate the total number of lines
for (int i = 0, imax = mParagraphs.size; i < imax; ++i)
mTotalLines += mParagraphs.buffer[i].lines.Length;
mParagraphs.buffer
.lines may be Null. Because of this, mParagraphs.buffer.lines.Length causes error: NullReferenceException: Object reference not set to an instance of an object
Function UpdateVisibleText() Line: also lacks this check for Null, and it causes error:
for (int i = 0, imax = mParagraphs.size; maxLines > 0 && i < imax; ++i)
{
Paragraph p = mParagraphs.buffer[i];
for (int b = 0, bmax = p.lines.Length; maxLines > 0 && b < bmax; ++b)
{
...
}
}
p.lines also may be Null, and therefore p.lines.Length causes error: NullReferenceException: Object reference not set to an instance of an object
This situation is possible when the function NGUIText.WrapText() (Line: 268) returns false.