mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
fix: possible crash
This commit is contained in:
@@ -3944,12 +3944,16 @@ void HistoryItem::setText(const TextWithEntities &textWithEntities) {
|
||||
const auto emoji = Ui::Emoji::Find(entityText, &emojiLength);
|
||||
if (emoji && emojiLength == entityText.size()) {
|
||||
const auto emojiId = match.captured(1);
|
||||
entity = EntityInText(
|
||||
EntityType::CustomEmoji,
|
||||
entity.offset(),
|
||||
entity.length(),
|
||||
emojiId);
|
||||
entity.setLocal();
|
||||
auto ok = false;
|
||||
emojiId.toULongLong(&ok);
|
||||
if (ok) {
|
||||
entity = EntityInText(
|
||||
EntityType::CustomEmoji,
|
||||
entity.offset(),
|
||||
entity.length(),
|
||||
emojiId);
|
||||
entity.setLocal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user