diff options
author | Will Nations <willnationsdev@gmail.com> | 2018-08-15 09:12:35 -0500 |
---|---|---|
committer | Will Nations <willnationsdev@gmail.com> | 2018-08-15 10:17:28 -0500 |
commit | 3ed92311175bb7024d7b51e7c70acbeaaf0b4947 (patch) | |
tree | ad898573687338748234b2b84092fe876cae8676 /editor/create_dialog.cpp | |
parent | d006aa0abb1c7580755a4fe72502d3a362d3f01f (diff) |
Fix error spam from loading script class icons
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index ab7a7054eb..0bc4244642 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -158,12 +158,15 @@ Ref<Texture> CreateDialog::_get_editor_icon(const String &p_type) const { } if (ScriptServer::is_global_class(p_type)) { - RES icon = ResourceLoader::load(EditorNode::get_editor_data().script_class_get_icon_path(p_type)); - if (icon.is_valid()) - return icon; - icon = get_icon(ScriptServer::get_global_class_base(p_type), "EditorIcons"); - if (icon.is_valid()) - return icon; + String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_type); + RES icon; + if (FileAccess::exists(icon_path)) { + icon = ResourceLoader::load(icon_path); + } + if (!icon.is_valid()) { + icon = get_icon(ScriptServer::get_global_class_base(p_type), "EditorIcons"); + } + return icon; } const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types(); |