Skip to content
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

Prevent crash when dropping Resource that can't load #90664

Merged
merged 1 commit into from
May 30, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 14, 2024

Fixes #90600

@KoBeWi KoBeWi added this to the 4.3 milestone Apr 14, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner April 14, 2024 13:29
Comment on lines +1842 to +1844
// Resource exists, but failed to load. We need only path and name, so we can use a dummy Resource instead.
resource.instantiate();
resource->set_path_cache(path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to always use this approach and save a costly load? Or it's not enough for some types of resources?

Copy link
Member Author

@KoBeWi KoBeWi Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_dropped_resource_line() also uses resource name, which currently can't be obtained without loading the Resource. Otherwise the method could just take path string.

@akien-mga akien-mga merged commit aa147b7 into godotengine:master May 30, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the shadowdropped_resource branch May 30, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Holding Ctrl while dragging a CSV file into a script crashes Godot 4.2.1
2 participants