diff --git a/clientgui/ProjectInfoPage.cpp b/clientgui/ProjectInfoPage.cpp index 2f62a3d772..dfb00fed43 100644 --- a/clientgui/ProjectInfoPage.cpp +++ b/clientgui/ProjectInfoPage.cpp @@ -461,10 +461,12 @@ void CProjectInfoPage::OnProjectCategorySelected( wxCommandEvent& WXUNUSED(event } // Set the first item to be the selected item and then pop the next event. - m_pProjectsCtrl->SetSelection(0); - wxCommandEvent evtEvent(wxEVT_COMMAND_LISTBOX_SELECTED, ID_PROJECTS); - ProcessEvent(evtEvent); - + if (m_pProjectsCtrl->GetCount() > 0) { + m_pProjectsCtrl->SetSelection(0); + wxCommandEvent evtEvent(wxEVT_COMMAND_LISTBOX_SELECTED, ID_PROJECTS); + ProcessEvent(evtEvent); + } + wxLogTrace(wxT("Function Start/End"), wxT("CProjectInfoPage::OnProjectCategorySelected - Function End")); }