From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:07:35 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorRelated in Edit mode. X-Git-Tag: release-0.09~22 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=7cd4ac64e549c65fafbd893cc91be5ffaa82455f;hp=728b1c28cca2a7472f3d979ecafcc697157664a6;p=xestiaab%2F.git Fixed potential crash with frmContactEditorRelated 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/frmContactEditorRelated.cpp b/source/contacteditor/frmContactEditorRelated.cpp index 31bbf7e..04cc162 100644 --- a/source/contacteditor/frmContactEditorRelated.cpp +++ b/source/contacteditor/frmContactEditorRelated.cpp @@ -99,7 +99,8 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) striter = RelatedListRelTypePtr->find(RelatedListIndex); - if (striter->first == RelatedListIndex){ + if (striter->first == RelatedListIndex && + striter != RelatedListRelTypePtr->end()){ strValue = striter->second; @@ -195,7 +196,8 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) intiter = RelatedListPrefPtr->find(RelatedListIndex); - if (intiter->first == RelatedListIndex && intiter->second > 0){ + if (intiter->first == RelatedListIndex && intiter->second > 0 && + intiter != RelatedListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();