Fix possible crash in dictionaries download.

Fixes #17258.
This commit is contained in:
John Preston 2022-01-05 01:03:38 +03:00
parent cb8f86bc8d
commit fe7b120003
1 changed files with 3 additions and 3 deletions

View File

@ -139,6 +139,9 @@ void DownloadDictionaryInBackground(
not_null<Main::Session*> session,
int counter,
std::vector<int> 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)) {