Skip to content

Commit c738ac8

Browse files
committed
Merge pull request godotengine#104152 from AeioMuch/no_empty_string_allowed
Don't allow empty string when splitting allowed types and allowed subtypes in `_is_drop_valid()` in EditorPropertyArray
2 parents 70f3d9a + d0cff82 commit c738ac8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

editor/editor_properties_array_dict.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
588588
StringName ftype = dir->get_file_type(idx_in_dir);
589589
String script_class = dir->get_file_resource_script_class(idx_in_dir);
590590

591-
for (String at : allowed_type.split(",")) {
591+
for (String at : allowed_type.split(",", false)) {
592592
at = at.strip_edges();
593593
// Fail if one of the files is not of allowed type.
594594
if (!ClassDB::is_parent_class(ftype, at) && !EditorNode::get_editor_data().script_class_is_parent(script_class, at)) {
@@ -613,7 +613,7 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
613613
script_class = EditorNode::get_singleton()->get_object_custom_type_name(res->get_script());
614614
}
615615

616-
for (String at : allowed_type.split(",")) {
616+
for (String at : allowed_type.split(",", false)) {
617617
at = at.strip_edges();
618618
if (ClassDB::is_parent_class(res_type, at) || EditorNode::get_editor_data().script_class_is_parent(script_class, at)) {
619619
return true;
@@ -631,7 +631,7 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
631631
if (subtype_hint_string == "NodePath") {
632632
return true;
633633
} else {
634-
for (String ast : subtype_hint_string.split(",")) {
634+
for (String ast : subtype_hint_string.split(",", false)) {
635635
ast = ast.strip_edges();
636636
allowed_subtype_array.append(ast);
637637
}

0 commit comments

Comments
 (0)