diff --git a/Telegram/SourceFiles/chat_helpers/spellchecker_common.cpp b/Telegram/SourceFiles/chat_helpers/spellchecker_common.cpp index 190a8b52b..a7e3b7d01 100644 --- a/Telegram/SourceFiles/chat_helpers/spellchecker_common.cpp +++ b/Telegram/SourceFiles/chat_helpers/spellchecker_common.cpp @@ -139,6 +139,9 @@ void DownloadDictionaryInBackground( not_null session, int counter, std::vector langs) { + if (counter >= langs.size()) { + return; + } const auto id = langs[counter]; counter++; const auto destroyer = [=] { @@ -154,9 +157,6 @@ void DownloadDictionaryInBackground( } } - if (counter >= langs.size()) { - return; - } DownloadDictionaryInBackground(session, counter, langs); }; if (DictionaryExists(id)) {