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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user