diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp index b89c8ec3a..c5bc917a4 100644 --- a/Telegram/SourceFiles/chat_helpers/message_field.cpp +++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp @@ -191,10 +191,11 @@ TextWithEntities StripSupportHashtag(TextWithEntities &&text) { auto &entity = *i; if (entity.offset() >= length) { i = text.entities.erase(i); + continue; } else if (entity.offset() + entity.length() > length) { entity.shrinkFromRight(length - entity.offset()); - ++i; } + ++i; } if (!text.text.isEmpty() && !text.text.endsWith('\n')) { text.text.append('\n');