From: Steve Brokenshire Date: Wed, 10 Feb 2016 00:02:39 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorNotes in Edit mode. X-Git-Tag: release-0.09~24 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=45df1265cf7e9107ce5efac410b1251e92d7018c;p=xestiaab%2F.git Fixed potential crash with frmContactEditorNotes 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/frmContactEditorNotes.cpp b/source/contacteditor/frmContactEditorNotes.cpp index 0dbfb78..e07687a 100644 --- a/source/contacteditor/frmContactEditorNotes.cpp +++ b/source/contacteditor/frmContactEditorNotes.cpp @@ -220,7 +220,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) striter = NotesListLangPtr->find(NotesListIndex); - if (striter->first == NotesListIndex){ + if (striter->first == NotesListIndex && + striter != NotesListLangPtr->end()){ strValue = striter->second; @@ -232,7 +233,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) intiter = NotesListPrefPtr->find(NotesListIndex); - if (intiter->first == NotesListIndex && intiter->second > 0){ + if (intiter->first == NotesListIndex && intiter->second > 0 && + intiter != NotesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();