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

Check if EditorNode exists before trying to generate preview #99846

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

demolke
Copy link
Contributor

@demolke demolke commented Nov 29, 2024

EditorNode is a very heavy object that current test harness cannot create, so after #96544 editor import cannot be tested as the new code path will try to create a screenshot.

Split off from #98909

EditorNode is a very heavy object that current test harness cannot create, so after godotengine#96544 editor import cannot be tested.

Split off from godotengine#98909
@akien-mga
Copy link
Member

This seems fine as a stopgap solution but it will replace what I assume is now a crash (?) with an error.
That error is IMO still a bug, normal usage of the engine shouldn't raise such errors.

I missed #96544 before it was merged but this is a somewhat risky change, the preview generation code is known to be pretty problematic (lots of resource loading happening on threads and sometimes leading to race conditions), so doing it in even more cases may lead to bugs, like this one.

I would suggest that for command line imports, no previews get generated at all. The main use case for command line import is for CI/CD and previews aren't useful in that scenario.

@akien-mga
Copy link
Member

I'll merge for now to workaround the regression, but this may require further work as suggested above.

@akien-mga akien-mga merged commit e3bb8f3 into godotengine:master Dec 2, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@demolke
Copy link
Contributor Author

demolke commented Dec 2, 2024

Btw I could only reproduce the null de-reference when trying to do an import from test. I didn't check what command line import does.

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.

4 participants