Skip to content

Commit

Permalink
Fix Camera2D crash when edited scene root is null
Browse files Browse the repository at this point in the history
  • Loading branch information
adamscott committed Jul 19, 2023
1 parent 8f175a8 commit deb45c0
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 deb45c0

Please sign in to comment.