diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-26 18:45:56 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-26 18:45:56 +0200 |
commit | b181ff28e8b034614225d08e7d8ed0add77d8240 (patch) | |
tree | 31f488b4dcb6e23b253dc8f4462d3ae8afd183a6 | |
parent | 645af49919d8149001766d34bd16afa3fc620d57 (diff) | |
parent | a83ea6b57ddbfbce656cd47a6d21cd6a13c37d5a (diff) | |
download | redot-engine-b181ff28e8b034614225d08e7d8ed0add77d8240.tar.gz |
Merge pull request #97491 from akien-mga/fix-filesystem-invalid-icon-crash
Fix EditorFileSystem crash when fetching icons for unknown file types
-rw-r--r-- | editor/editor_file_system.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index bc46d01892..afa0548044 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1978,7 +1978,10 @@ void EditorFileSystem::_update_file_icon_path(EditorFileSystemDirectory::FileInf } if (icon_path.is_empty() && !file_info->type.is_empty()) { - icon_path = EditorNode::get_singleton()->get_class_icon(file_info->type)->get_path(); + Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(file_info->type); + if (icon.is_valid()) { + icon_path = icon->get_path(); + } } file_info->icon_path = icon_path; |