Repository: godotengine/godot (language: cpp)

Issue:
Parameter "edited_layer" is null problem
### Tested versions

Godot 4.3.stable

### System information

Godot v4.3.stable (77dcf97d8) - Windows 10.0.19045 - Vulkan (Mobile) - integrated Intel(R) HD Graphics 620 (Intel Corporation; 31.0.101.2127) - Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 Threads)

### Issue description

https://github.com/user-attachments/assets/de4ddf95-f4dc-44e5-8eb3-43841ed03af6

I have the same problem like in this topic: [link 1](https://forum.godotengine.org/t/parameter-edited-layer-is-null/84390)
The console said this everytime i focus on other node (not TileMapLayer)

`Parameter “edited_layer” is null`

### Steps to reproduce

https://github.com/user-attachments/assets/595dfb1b-9be9-41b2-a253-d14392d45ed5


### Minimal reproduction project (MRP)

[TestItOut.zip](https://github.com/user-attachments/files/18008112/TestItOut.zip)



Discussion / hints:

Fix patch:
diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp
index af93af3e9391..2ec5b28d0740 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<TileSet> tile_set = edited_layer->get_tile_set();
 	if (tile_set.is_null()) {


Test patch: