2
0
Эх сурвалжийг харах

Variant: Fix potential crash when stringifying deleted Object

Fixes #38597.
Sergey Minakov 5 жил өмнө
parent
commit
af1788baf3

+ 4 - 0
core/variant.cpp

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