Merge pull request #69894 from evan-gordon/text-server-uppercase-fix

check for empty string TextServer _string_to_upper
This commit is contained in:
Rémi Verschelde 2022-12-11 22:34:42 +01:00 committed by GitHub
commit 71eccdff8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6196,6 +6196,9 @@ String TextServerAdvanced::_strip_diacritics(const String &p_string) const {
}
String TextServerAdvanced::_string_to_upper(const String &p_string, const String &p_language) const {
if (p_string.is_empty()) {
return p_string;
}
const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
// Convert to UTF-16.
@ -6215,6 +6218,9 @@ String TextServerAdvanced::_string_to_upper(const String &p_string, const String
}
String TextServerAdvanced::_string_to_lower(const String &p_string, const String &p_language) const {
if (p_string.is_empty()) {
return p_string;
}
const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
// Convert to UTF-16.
Char16String utf16 = p_string.utf16();