Skip to content

Commit 3a3af8d

Browse files
committed
Merge pull request godotengine#112899 from timothyqiu/empty-locale
Prevent the main locale from being set to an empty string
2 parents 3f5b871 + 04ac5cb commit 3a3af8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/string/translation_server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ String TranslationServer::get_country_name(const String &p_country) const {
464464
}
465465

466466
void TranslationServer::set_locale(const String &p_locale) {
467+
ERR_FAIL_COND_MSG(p_locale.is_empty(), "Locale cannot be an empty string.");
468+
467469
String new_locale = standardize_locale(p_locale);
468470
if (locale == new_locale) {
469471
return;

0 commit comments

Comments
 (0)