diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2019-02-22 19:27:13 +0100 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2019-02-22 19:28:19 +0100 |
commit | 4f49d09272d4885629bdde484edea875d9b45c94 (patch) | |
tree | d66d46b44bf5557c6c6f205fb3baa9e025149bef /core/ustring.cpp | |
parent | aef5b36bfaf6b379ddeb4809312c1fc465f35779 (diff) | |
download | redot-engine-4f49d09272d4885629bdde484edea875d9b45c94.tar.gz |
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.
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r-- | core/ustring.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index b9914fb530..ff8fcaaaaf 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -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; |