Merge pull request #39736 from naithar/fix/deleted-object-stringify

Fix for a crash on printing freed object
This commit is contained in:
Rémi Verschelde 2020-06-22 10:02:30 +02:00 committed by GitHub
commit 75791358c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1598,6 +1598,10 @@ String Variant::stringify(List<const void *> &stack) const {
Object *obj = _OBJ_PTR(*this);
if (obj) {
if (_get_obj().ref.is_null() && !ObjectDB::get_instance(obj->get_instance_id())) {
return "[Deleted Object]";
}
return obj->to_string();
} else {
#ifdef DEBUG_ENABLED