mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
Merge pull request #90414 from jsjtxietian/assign-crash
Fix `_node_assign` will crash when `base_node` is nullptr
This commit is contained in:
commit
8c6e8c72a2
@ -2755,7 +2755,8 @@ void EditorPropertyNodePath::_node_assign() {
|
||||
Variant val = get_edited_property_value();
|
||||
Node *n = nullptr;
|
||||
if (val.get_type() == Variant::Type::NODE_PATH) {
|
||||
n = get_base_node()->get_node_or_null(val);
|
||||
Node *base_node = get_base_node();
|
||||
n = base_node == nullptr ? nullptr : base_node->get_node_or_null(val);
|
||||
} else {
|
||||
n = Object::cast_to<Node>(val);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user