summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCory Petkovsek <632766+TokisanGames@users.noreply.github.com>2024-06-21 00:18:34 +0700
committerCory Petkovsek <632766+TokisanGames@users.noreply.github.com>2024-06-21 00:18:34 +0700
commit1780f2840765358b52d8f9bd28a488fd3ef89842 (patch)
tree766f936e21018e1b170149d19c5dc7d37a5b04c1
parent6fb3b727564a4afa42b03acc269bf6bb5ba1a139 (diff)
downloadredot-engine-1780f2840765358b52d8f9bd28a488fd3ef89842.tar.gz
Fix crash when drawing a selection box on an empty scene with certain plugins
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 1f3bf60d24..74a076c787 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -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]));