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

Fix Camera2D crash when edited scene root is null #79645

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Jul 19, 2023

The current code assumes that get_tree()->get_edited_scene_root() is available when Engine::get_singleton->is_editor_hint() is true, but it isn't when the Camera2D is instantiated as an editor plugin.

This PR simply adds a check.

Fixes #76035
Fixes #77670

@adamscott adamscott added bug topic:editor crash topic:2d cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 19, 2023
@adamscott adamscott added this to the 4.x milestone Jul 19, 2023
@adamscott adamscott requested a review from a team as a code owner July 19, 2023 00:40
@adamscott adamscott modified the milestones: 4.x, 4.2 Jul 19, 2023
@YuriSizov
Copy link
Contributor

Does this fix #76035 and #77670?

@adamscott
Copy link
Member Author

Does this fix #76035 and #77670?

Yes, it should fix #76035 and #77670

@YuriSizov YuriSizov merged commit 7a31331 into godotengine:master Jul 21, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants