From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:11:23 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorTitles in Edit mode. X-Git-Tag: release-0.09~18 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=b813f99bbcbdf103f82ece0935419a784f0f51e9 Fixed potential crash with frmContactEditorTitles in Edit mode. This would be caused because no checks were made on the iterator to see if it was valid or not. --- diff --git a/source/contacteditor/frmContactEditorTitles.cpp b/source/contacteditor/frmContactEditorTitles.cpp index 497c28e..4de0d1a 100644 --- a/source/contacteditor/frmContactEditorTitles.cpp +++ b/source/contacteditor/frmContactEditorTitles.cpp @@ -175,7 +175,8 @@ void frmContactEditorTitles::SetEditorMode(bool EditMode, SectionType SectType) striter = TitlesListPtr->find(TitlesListIndex); - if (striter->first == TitlesListIndex){ + if (striter->first == TitlesListIndex && + striter != TitlesListPtr->end()){ strValue = striter->second; @@ -189,7 +190,8 @@ void frmContactEditorTitles::SetEditorMode(bool EditMode, SectionType SectType) intiter = TitlesListPrefPtr->find(TitlesListIndex); - if (intiter->first == TitlesListIndex && intiter->second > 0){ + if (intiter->first == TitlesListIndex && intiter->second > 0 && + intiter != TitlesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();