Fix crash when drawing a selection box on an empty scene with certain plugins

This commit is contained in:
Cory Petkovsek 2024-06-21 00:18:34 +07:00
parent 6fb3b72756
commit 1780f28407
1 changed files with 3 additions and 0 deletions

View File

@ -1043,6 +1043,9 @@ void Node3DEditorViewport::_select_region() {
Vector<Node *> selected;
Node *edited_scene = get_tree()->get_edited_scene_root();
if (edited_scene == nullptr) {
return;
}
for (int i = 0; i < instances.size(); i++) {
Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));