From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:54:45 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorLanguages in Edit mode. X-Git-Tag: release-0.09~26 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=inline;h=ca109c344b3fb17cf7000c87eb656febee3a6316;p=xestiaab%2F.git Fixed potential crash with frmContactEditorLanguages 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/frmContactEditorLanguages.cpp b/source/contacteditor/frmContactEditorLanguages.cpp index d13d804..0cd628c 100644 --- a/source/contacteditor/frmContactEditorLanguages.cpp +++ b/source/contacteditor/frmContactEditorLanguages.cpp @@ -74,7 +74,8 @@ void frmContactEditorLanguages::SetEditorMode(bool EditMode, SectionType SectTyp intiter = LanguageListPrefPtr->find(LanguageListIndex); - if (intiter->first == LanguageListIndex && intiter->second > 0){ + if (intiter->first == LanguageListIndex && intiter->second > 0 && + intiter != LanguageListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();