summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-12-11 22:34:42 +0100
committerGitHub <noreply@github.com>2022-12-11 22:34:42 +0100
commit71eccdff8b119b4213c1078954dc2fdf9685eb7e (patch)
treec5ffb955d753828059a0be24946cb13600481059
parent8410e7c9c60b52ce5bd431ab0dae93fbe687589e (diff)
parent88015b0edb0054c4d011696b6987757321ab62aa (diff)
Merge pull request #69894 from evan-gordon/text-server-uppercase-fix
check for empty string TextServer _string_to_upper
-rw-r--r--modules/text_server_adv/text_server_adv.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index cf77d0ed7f..512643867b 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -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();