-
-
Notifications
You must be signed in to change notification settings - Fork 22.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GDExtension classes inheriting from Resource not using icons in FileSystem #97421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me! Tested with the MRP on master and with this PR and it fixes the issue as expected.
Thanks! |
This seems to cause a crash in one of my test projects:
Trying to figure out why and make a MRP. |
It's crashing for me when there's an Edit: #97491 should fix it. |
@@ -1872,6 +1872,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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrongly assuming that the result of EditorNode::get_singleton()->get_class_icon(file_info->type)
is valid and can de-referenced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by #97491.
Fixes crash reported in godotengine#97421 (comment).
Fixes crash reported in godotengine#97421 (comment).
Fixes crash reported in godotengine#97421 (comment).
Fixes crash reported in godotengine#97421 (comment).
fix #97387