Don't assume a tree root.

Fixes KICAD-Y72.

(cherry picked from commit 6c6c02a329b1ddad9d132bb682b3596bfb0bb528)
This commit is contained in:
Jeff Young 2025-08-01 13:54:06 +01:00
parent 0da6ca2300
commit d917ff6893

View File

@ -1141,7 +1141,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;