From 88a2f05c6de6f5a8cbac6ad03abfe523a73fdfb9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 31 Aug 2021 22:25:37 +0300 Subject: [PATCH] Fix crash in new phone formatting. --- Telegram/SourceFiles/countries/countries_instance.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/SourceFiles/countries/countries_instance.cpp b/Telegram/SourceFiles/countries/countries_instance.cpp index 36967370bd..e9be668177 100644 --- a/Telegram/SourceFiles/countries/countries_instance.cpp +++ b/Telegram/SourceFiles/countries/countries_instance.cpp @@ -355,6 +355,9 @@ FormatResult CountriesInstance::format(FormatArgs args) { ? QVector() : QVector{ codeSize }; auto groupSize = 0; + if (bestCallingCodePtr->patterns.empty()) { + return FormatResult{ .groups = std::move(groups) }; + } for (const auto &c : bestCallingCodePtr->patterns.front()) { if (c == ' ') { groups.push_back(base::take(groupSize));