diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index dfbc07b8b3..ac9092c6bf 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -1196,6 +1196,9 @@ Vector String::split_floats(const String &p_splitter, bool p_allow_empty Vector ret; int from = 0; int len = length(); + if (len == 0) { + return ret; + } String buffer = *this; while (true) { @@ -1223,6 +1226,9 @@ Vector String::split_floats_mk(const Vector &p_splitters, bool p_ Vector ret; int from = 0; int len = length(); + if (len == 0) { + return ret; + } String buffer = *this; while (true) { @@ -1255,6 +1261,9 @@ Vector String::split_ints(const String &p_splitter, bool p_allow_empty) con Vector ret; int from = 0; int len = length(); + if (len == 0) { + return ret; + } while (true) { int end = find(p_splitter, from); @@ -1279,6 +1288,9 @@ Vector String::split_ints_mk(const Vector &p_splitters, bool p_allo Vector ret; int from = 0; int len = length(); + if (len == 0) { + return ret; + } while (true) { int idx = 0;