From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:58:03 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorNickname in Edit mode. X-Git-Tag: release-0.09~25 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=inline;h=e69c0acfe562c70333fc29bf84a13ec6a76d6fe4;p=xestiaab%2F.git Fixed potential crash with frmContactEditorNickname 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/frmContactEditorNickname.cpp b/source/contacteditor/frmContactEditorNickname.cpp index 62937af..c0ecc2f 100644 --- a/source/contacteditor/frmContactEditorNickname.cpp +++ b/source/contacteditor/frmContactEditorNickname.cpp @@ -198,7 +198,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType striter = NicknamesListLanguagePtr->find(NicknamesListIndex); - if (striter->first == NicknamesListIndex){ + if (striter->first == NicknamesListIndex && + striter != NicknamesListLanguagePtr->end()){ strValue = striter->second; @@ -211,7 +212,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType intiter = NicknamesListPrefPtr->find(NicknamesListIndex); - if (intiter->first == NicknamesListIndex && intiter->second > 0){ + if (intiter->first == NicknamesListIndex && intiter->second > 0 && + intiter != NicknamesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();