diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2018-01-20 15:28:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-20 15:28:43 +0100 |
commit | 3cd5b1fec835598b777fdfdd9f9265a495d47029 (patch) | |
tree | 609eb415aa1837e46d5af05325807ec80fff96b4 | |
parent | 09732a15a50cedc4d495588f77784c26d3b3c7a7 (diff) | |
parent | 30822e8ab7735f3a715d4375292df5f0989ab788 (diff) |
Merge pull request #15891 from karroffel/stringbuilder-fix-crash
fixed crash with StringBuilder
-rw-r--r-- | core/string_builder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/string_builder.cpp b/core/string_builder.cpp index 4d567cbc03..8ab7e0ea8f 100644 --- a/core/string_builder.cpp +++ b/core/string_builder.cpp @@ -56,6 +56,9 @@ StringBuilder &StringBuilder::append(const char *p_cstring) { String StringBuilder::as_string() const { + if (string_length == 0) + return ""; + CharType *buffer = memnew_arr(CharType, string_length); int current_position = 0; |