mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Don't crash when parse_utf8 receives a NULL pointer
This can happen when chaining calls to various string methods when the string is empty.
This commit is contained in:
@@ -1359,6 +1359,9 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {
|
||||
|
||||
#define _UNICERROR(m_err) print_line("Unicode error: " + String(m_err));
|
||||
|
||||
if (!p_utf8)
|
||||
return true;
|
||||
|
||||
String aux;
|
||||
|
||||
int cstr_size = 0;
|
||||
|
||||
Reference in New Issue
Block a user