From ca109c344b3fb17cf7000c87eb656febee3a6316 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:54:45 +0000 Subject: [PATCH] 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. --- source/contacteditor/frmContactEditorLanguages.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); -- 2.39.5