@@ -43,7 +43,9 @@ QJsonObject LocaleAttached::countriesForLanguage(const QString &code) const
4343 Q_FOREACH(const QLocale &loc, allLocales) {
4444 const QString countryCode = loc.name().section('_', 1, 1);
4545 //qDebug() << "Matching country:" << countryCode;
46− result.insert(countryCode, QLocale::countryToString(loc.country()));
46+ if (!countryCode.isEmpty()) {
47+ result.insert(countryCode, QLocale::countryToString(loc.country()));
48+ }
4749 }
4850 return result;
4951}
@@ -55,7 +57,7 @@ QJsonObject LocaleAttached::countries() const
5557
5658 Q_FOREACH(const QLocale &loc, allLocales) {
5759 const QString countryCode = loc.name().section('_', 1, 1);
58− if (!countryCode.isEmpty() && countryCode.length() == 2) {
60+ if (countryCode.length() == 2) {
5961 result.insert(countryCode, QLocale::countryToString(loc.country()));
6062 }
6163 }