Fix a crash bug that occurred when the "Limit message height" setting was enabled and a message was being split up into multiple lines. IRC only. (#2329)

This commit is contained in:
pajlada
2021-01-02 14:49:03 +01:00
committed by GitHub
parent c64fd56831
commit d3b2ab1d8a
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -623,6 +623,11 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
// XXX(pajlada): NOT TESTED
for (int i = 0; i < textLength; i++)
{
if (!container.canAddElements())
{
break;
}
auto isSurrogate = text.size() > i + 1 &&
QChar::isHighSurrogate(text[i].unicode());