Fix Camera2D crash when edited scene root is null
(cherry picked from commit deb45c0cab
)
This commit is contained in:
parent
f8ffad873a
commit
f3302b8089
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue