You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
fix crash after click on MeshInstance with no owner
Due to how spatial selection works, after clicking on MeshInstance that had no owner editor was crashing.
This commit is contained in:
@@ -285,11 +285,11 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
|
|||||||
|
|
||||||
Node *subscene_candidate = spat;
|
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();
|
subscene_candidate = subscene_candidate->get_owner();
|
||||||
|
|
||||||
spat = subscene_candidate->cast_to<Spatial>();
|
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);
|
subscenes.push_back(spat);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user