summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorkleonc <9283098+kleonc@users.noreply.github.com>2022-07-22 18:29:10 +0200
committerkleonc <9283098+kleonc@users.noreply.github.com>2022-07-22 18:32:36 +0200
commit07118d70943c450b30fa3c6e0bc985474a227a76 (patch)
treec54824bc4c384d8fca9f6ee65bbbe5c0a48a0904 /editor
parent79463aa5defb083569d193658a62755223f14dc4 (diff)
Fix in editor drag and dropping a `Node` to generic `NodePath` property
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_properties.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index aaa518362c..be447490ff 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3177,6 +3177,11 @@ bool EditorPropertyNodePath::is_drop_valid(const Dictionary &p_drag_data) const
Node *dropped_node = get_tree()->get_edited_scene_root()->get_node(nodes[0]);
ERR_FAIL_NULL_V(dropped_node, false);
+ if (valid_types.is_empty()) {
+ // No type requirements specified so any type is valid.
+ return true;
+ }
+
for (const StringName &E : valid_types) {
if (dropped_node->is_class(E)) {
return true;