diff options
| author | Rémi Verschelde | 2017-08-13 17:18:12 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-13 17:18:12 +0200 |
| commit | 1ec6300421d146da6590120b0d0f4c2d53811695 (patch) | |
| tree | 7b85cfc3fb56acb191a8ee0353ca6f8a6ba17e34 | |
| parent | 4391b67e16b47b1be8eda69519a88546438dce8c (diff) | |
| parent | be8ae8df938765e5d218c5ec781c85ea8fe43bf8 (diff) | |
| download | godot-1ec6300421d146da6590120b0d0f4c2d53811695.tar.gz godot-1ec6300421d146da6590120b0d0f4c2d53811695.tar.zst godot-1ec6300421d146da6590120b0d0f4c2d53811695.zip | |
Merge pull request #10258 from kubecz3k/spatial-select-no-owner-fix
fix crash after click on MeshInstance with no owner
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index a549f09cb..13fdb7ac9 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -285,11 +285,11 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, Node *subscene_candidate = spat; - while (subscene_candidate->get_owner() != editor->get_edited_scene()) + while ((subscene_candidate->get_owner() != NULL) && (subscene_candidate->get_owner() != editor->get_edited_scene())) subscene_candidate = subscene_candidate->get_owner(); spat = subscene_candidate->cast_to<Spatial>(); - if (spat && (spat->get_filename() != "")) + if (spat && (spat->get_filename() != "") && (subscene_candidate->get_owner() != NULL)) subscenes.push_back(spat); continue; |
