Fix crash in new phone formatting.

This commit is contained in:
John Preston 2021-08-31 22:25:37 +03:00
parent df15c67dab
commit 88a2f05c6d

View file

@ -355,6 +355,9 @@ FormatResult CountriesInstance::format(FormatArgs args) {
? QVector<int>()
: QVector<int>{ 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));