From 45466560e71e2cb545fc7087947840820f1ba32c Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Sun, 29 Dec 2024 22:17:04 +0100 Subject: [PATCH] [manager] fix crash when launching BOINC Manager on the fresh system without any projects connected Signed-off-by: Vitalii Koshura --- clientgui/ProjectInfoPage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clientgui/ProjectInfoPage.cpp b/clientgui/ProjectInfoPage.cpp index e62936e3db..aed7112bfd 100644 --- a/clientgui/ProjectInfoPage.cpp +++ b/clientgui/ProjectInfoPage.cpp @@ -276,8 +276,12 @@ void CProjectInfoPage::CreateControls() // canonicalized and trimmed URLs. This will be used for comparing against the master list of projects // to visually indicate which projectes have already been attached. // - for (unsigned int i = 0; i < pDoc->GetProjectCount(); i++) { - tempstring = pDoc->project(i)->master_url; + for (int i = 0; i < pDoc->GetProjectCount(); i++) { + PROJECT* pProject = pDoc->project(i); + if (!pProject) { + continue; + } + tempstring = pProject->master_url; canonicalize_master_url(tempstring); TrimURL(tempstring); m_pTrimmedURL_attached.push_back(tempstring);