diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-07 12:38:29 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-07 12:38:29 +0200 |
commit | fbe663940c5df19669432b2818532f3a9bef1bb1 (patch) | |
tree | d88878930323b894667bcaf686ed75faddafbc77 /editor | |
parent | 1cfcc04ffdeb40e5bb3b19fd3f6d8f06250096a3 (diff) | |
parent | 8ebaf4437ae603031495270ba233941eca67e7e5 (diff) | |
download | redot-engine-fbe663940c5df19669432b2818532f3a9bef1bb1.tar.gz |
Merge pull request #93974 from groud/fix_crash_editable_children_tilemaplayer
Fix crash in the TileMapLayer editor when using editable children
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tiles/tile_map_layer_editor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index d3afd25502..4a59530159 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -3630,9 +3630,16 @@ TileMapLayer *TileMapLayerEditor::_get_edited_layer() const { void TileMapLayerEditor::_find_tile_map_layers_in_scene(Node *p_current, const Node *p_owner, Vector<TileMapLayer *> &r_list) const { ERR_FAIL_COND(!p_current || !p_owner); - if (p_current != p_owner && p_current->get_owner() != p_owner) { - return; + + if (p_current != p_owner) { + if (!p_current->get_owner()) { + return; + } + if (p_current->get_owner() != p_owner && !p_owner->is_editable_instance(p_current->get_owner())) { + return; + } } + TileMapLayer *layer = Object::cast_to<TileMapLayer>(p_current); if (layer) { r_list.append(layer); |