Browse Source

Avoid retrieving the object ID of a Nil variable

Chia-Hsiang Cheng 2 years ago
parent
commit
8da66412f6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/debugger/editor_debugger_inspector.cpp

+ 1 - 1
editor/debugger/editor_debugger_inspector.cpp

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