Merge pull request #93404 from TokisanGames/fix-empty-scene-crash
Fix crash in Node3DEditorViewport selecting on empty scene
This commit is contained in:
commit
e2be29c2a9
|
@ -1051,6 +1051,9 @@ void Node3DEditorViewport::_select_region() {
|
||||||
Vector<Node *> selected;
|
Vector<Node *> selected;
|
||||||
|
|
||||||
Node *edited_scene = get_tree()->get_edited_scene_root();
|
Node *edited_scene = get_tree()->get_edited_scene_root();
|
||||||
|
if (edited_scene == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < instances.size(); i++) {
|
for (int i = 0; i < instances.size(); i++) {
|
||||||
Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
|
Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
|
||||||
|
|
Loading…
Reference in New Issue