Check if class exists before checking if it's virtual in Create Dialog

This commit is contained in:
Aaron Franke 2022-12-11 13:12:45 -06:00
parent 05097ded0a
commit 137508dfc8
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF

View File

@ -284,8 +284,9 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
bool can_instantiate = (p_type_category == TypeCategory::CPP_TYPE && ClassDB::can_instantiate(p_type)) ||
p_type_category == TypeCategory::OTHER_TYPE;
bool is_virtual = ClassDB::class_exists(p_type) && ClassDB::is_virtual(p_type);
if (can_instantiate && !ClassDB::is_virtual(p_type)) {
if (can_instantiate && !is_virtual) {
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
} else {
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));