From ea1123cad6e63cf54e1526bc634e3fddde10e7cd Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 6 Feb 2013 04:33:54 -0800 Subject: [PATCH] MGR: Fix assert when all_projects_list.xml file is missing --- clientgui/ProjectInfoPage.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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")); }