Skip to content

Commit

Permalink
Variant: Fix potential crash when stringifying deleted Object
Browse files Browse the repository at this point in the history
  • Loading branch information
naithar authored and h committed Nov 10, 2020
1 parent a1834de commit 18543f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 18543f3

Please sign in to comment.