Fix crash on tree select when item no longer exists after DOM rebuild

Guard tree.get_children() with tree.exists() so a stale item ID from
a COV or lazy-load rebuild does not raise TclError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-11 23:43:22 +03:00
co-authored by Claude Opus 4.6
parent dafebcebda
commit 4431f11d83
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it.
import configparser
import os
VERSION = "0.0.0.074"
VERSION = "0.0.0.075"
PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties")
DEFAULT_GRID_SIZE = 10
DEFAULT_ADD_TIMESTAMP = True
+1 -1
View File
@@ -629,7 +629,7 @@ def on_tree_select(event):
if element is not None:
components_to_render = [child for child in element if child.tag == "comp"]
else:
elif tree.exists(selected_id):
top_level_ids = tree.get_children(selected_id)
for t_id in top_level_ids:
comp_elem = app_state.tree_element_map.get(t_id)