Skip to content

Commit

Permalink
Merge pull request godotengine#97491 from akien-mga/fix-filesystem-in…
Browse files Browse the repository at this point in the history
…valid-icon-crash

Fix EditorFileSystem crash when fetching icons for unknown file types
  • Loading branch information
akien-mga committed Sep 26, 2024
2 parents 645af49 + a83ea6b commit b181ff2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b181ff2

Please sign in to comment.