Merge pull request #10258 from kubecz3k/spatial-select-no-owner-fix
fix crash after click on MeshInstance with no owner
This commit is contained in:
commit
1ec6300421
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue