From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:43:47 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorEmail in Edit mode. X-Git-Tag: release-0.09~30 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=296baaf67d5aef9ed8e57f9de85a3d16ea86d767;hp=c652fc6a8c7adb87cd00a96548d2f6275842f9f8;p=xestiaab%2F.git Fixed potential crash with frmContactEditorEmail 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/frmContactEditorEmail.cpp b/source/contacteditor/frmContactEditorEmail.cpp index 2830a65..407b63b 100644 --- a/source/contacteditor/frmContactEditorEmail.cpp +++ b/source/contacteditor/frmContactEditorEmail.cpp @@ -188,13 +188,14 @@ void frmContactEditorEmail::SetEditorMode(bool EditMode, SectionType SectType) intiter = EmailListPrefPtr->find(EmailListIndex); - if (intiter->first == EmailListIndex && intiter->second > 0){ + if (intiter->first == EmailListIndex && intiter->second > 0 && + intiter != EmailListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); chkUsePref->SetValue(TRUE); - } + } }