Don't assume a tree root.

Fixes KICAD-Y72.
This commit is contained in:
Jeff Young 2025-08-01 13:54:06 +01:00
parent bf21edb7ce
commit 6c6c02a329

View File

@ -1143,7 +1143,7 @@ void PROJECT_TREE_PANE::onIdle( wxIdleEvent& aEvent )
FileWatcherReset();
}
if( m_selectedItem != nullptr )
if( m_selectedItem != nullptr && m_TreeProject->GetRootItem().IsOk() )
{
// Make sure m_selectedItem still exists in the tree before activating it.
std::vector<wxTreeItemId> validItemIds;