diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index af93af3e939..2ec5b28d074 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -3345,7 +3345,9 @@ void TileMapLayerEditorTerrainsPlugin::_update_terrains_tree() { terrains_tree->create_item(); const TileMapLayer *edited_layer = _get_edited_layer(); - ERR_FAIL_NULL(edited_layer); + if (!edited_layer) { + return; + } Ref tile_set = edited_layer->get_tile_set(); if (tile_set.is_null()) {