Avoid retrieving the object ID of a Nil variable

This commit is contained in:
Chia-Hsiang Cheng 2023-08-04 22:38:43 +08:00
parent eb4301b941
commit 8da66412f6

View file

@ -232,7 +232,7 @@ void EditorDebuggerInspector::add_stack_variable(const Array &p_array) {
PropertyHint h = PROPERTY_HINT_NONE; PropertyHint h = PROPERTY_HINT_NONE;
String hs; String hs;
if (var.var_type == Variant::OBJECT) { if (var.var_type == Variant::OBJECT && v) {
v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id(); v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id();
h = PROPERTY_HINT_OBJECT_ID; h = PROPERTY_HINT_OBJECT_ID;
hs = "Object"; hs = "Object";