Skip to content

Commit

Permalink
Merge pull request #79645 from adamscott/fix-camera-2d-editor
Browse files Browse the repository at this point in the history
Fix Camera2D crash when edited scene root is null
  • Loading branch information
YuriSizov committed Jul 21, 2023
2 parents 1843781 + deb45c0 commit 7a31331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/2d/camera_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Camera2D::_update_scroll() {
if (Engine::get_singleton()->is_editor_hint()) {
queue_redraw();
// Only set viewport transform when not bound to the main viewport.
if (get_viewport() == get_tree()->get_edited_scene_root()->get_viewport()) {
if (get_tree()->get_edited_scene_root() && get_viewport() == get_tree()->get_edited_scene_root()->get_viewport()) {
return;
}
}
Expand Down

0 comments on commit 7a31331

Please sign in to comment.