You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Fixes issue when inspecting nodes that are not in the tree
This commit is contained in:
@@ -601,9 +601,19 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Node *node = Object::cast_to<Node>(obj)) {
|
if (Node *node = Object::cast_to<Node>(obj)) {
|
||||||
|
// in some cases node will not be in tree here
|
||||||
|
// for instance where it created as variable and not yet added to tree
|
||||||
|
// in such cases we can't ask for it's path
|
||||||
|
if (node->is_inside_tree()) {
|
||||||
PropertyInfo pi(Variant::NODE_PATH, String("Node/path"));
|
PropertyInfo pi(Variant::NODE_PATH, String("Node/path"));
|
||||||
properties.push_front(PropertyDesc(pi, node->get_path()));
|
properties.push_front(PropertyDesc(pi, node->get_path()));
|
||||||
|
} else {
|
||||||
|
PropertyInfo pi(Variant::STRING, String("Node/path"));
|
||||||
|
properties.push_front(PropertyDesc(pi, "[Orphan]"));
|
||||||
|
}
|
||||||
|
|
||||||
} else if (Resource *res = Object::cast_to<Resource>(obj)) {
|
} else if (Resource *res = Object::cast_to<Resource>(obj)) {
|
||||||
if (Script *s = Object::cast_to<Script>(res)) {
|
if (Script *s = Object::cast_to<Script>(res)) {
|
||||||
Map<StringName, Variant> constants;
|
Map<StringName, Variant> constants;
|
||||||
|
|||||||
Reference in New Issue
Block a user