From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:05:20 +0000 (+0000) Subject: Fixed crash in frmContactEditorOrganisations in Edit mode. X-Git-Tag: release-0.09~35 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=sidebyside;h=13f15009712742722a3210c92dd296a2cb514879;p=xestiaab%2F.git Fixed crash in frmContactEditorOrganisations in Edit mode. This is caused because no checks were made on the iterator to see if it was valid or not. --- diff --git a/source/contacteditor/frmContactEditorOrganisations.cpp b/source/contacteditor/frmContactEditorOrganisations.cpp index b6c2e19..9aa5f50 100644 --- a/source/contacteditor/frmContactEditorOrganisations.cpp +++ b/source/contacteditor/frmContactEditorOrganisations.cpp @@ -239,7 +239,8 @@ void frmContactEditorOrganisations::SetEditorMode(bool EditMode, SectionType Sec striter = OrganisationListSortAsPtr->find(OrganisationListIndex); - if (striter->first == OrganisationListIndex){ + if (striter->first == OrganisationListIndex && + striter != OrganisationListSortAsPtr->end()){ strValue = striter->second; @@ -251,7 +252,8 @@ void frmContactEditorOrganisations::SetEditorMode(bool EditMode, SectionType Sec intiter = OrganisationListPrefPtr->find(OrganisationListIndex); - if (intiter->first == OrganisationListIndex && intiter->second > 0){ + if (intiter->first == OrganisationListIndex && intiter->second > 0 && + striter != OrganisationListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();