1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

make sure array is created if not existing, as noted by Guilherme Felipe

This commit is contained in:
Juan Linietsky
2015-08-25 23:09:41 -03:00
parent d50921b550
commit b0be30d9ef
4 changed files with 14 additions and 7 deletions

View File

@@ -3057,12 +3057,11 @@ String String::world_wrap(int p_chars_per_line) const {
if (i-from>=p_chars_per_line) {
if (last_space==-1) {
ret+=substr(from,i-from+1)+"\n";
from=i+1;
} else {
ret+=substr(from,last_space-from)+"\n";
i=last_space;
from=i+1;
i=last_space; //rewind
}
from=i+1;
last_space=-1;
} else if (operator[](i)==' ' || operator[](i)=='\t') {
last_space=i;