Fix crash when using Camera2D::set_custom_viewport()
(cherry picked from commit b89befe173
)
This commit is contained in:
parent
883c3dc413
commit
8b8bafbd53
@ -582,6 +582,10 @@ void Camera2D::set_custom_viewport(Node *p_viewport) {
|
||||
remove_from_group(canvas_group_name);
|
||||
}
|
||||
|
||||
if (custom_viewport && !ObjectDB::get_instance(custom_viewport_id)) {
|
||||
viewport = nullptr;
|
||||
}
|
||||
|
||||
custom_viewport = Object::cast_to<Viewport>(p_viewport);
|
||||
|
||||
if (custom_viewport) {
|
||||
|
Loading…
Reference in New Issue
Block a user