Fixed crash in translate box for text with spoilers.

This commit is contained in:
23rd 2022-12-02 01:22:30 +03:00
parent 92756f418b
commit fe6ad54836
1 changed files with 6 additions and 0 deletions

View File

@ -160,6 +160,12 @@ void TranslateBox(
};
const auto state = box->lifetime().make_state<State>();
text.entities = ranges::views::all(
text.entities
) | ranges::views::filter([](const EntityInText &e) {
return e.type() != EntityType::Spoiler;
}) | ranges::to<EntitiesInText>();
if (!IsServerMsgId(msgId)) {
msgId = 0;
}