From: Steve Brokenshire Date: Wed, 10 Feb 2016 00:05:51 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorPicture in Edit mode. X-Git-Tag: release-0.09~23 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=inline;h=728b1c28cca2a7472f3d979ecafcc697157664a6;p=xestiaab%2F.git Fixed potential crash with frmContactEditorPicture 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/frmContactEditorPicture.cpp b/source/contacteditor/frmContactEditorPicture.cpp index 9a72372..d6ffcc3 100644 --- a/source/contacteditor/frmContactEditorPicture.cpp +++ b/source/contacteditor/frmContactEditorPicture.cpp @@ -267,8 +267,7 @@ void frmContactEditorPicture::ProcessData( wxCommandEvent& event ) return; } - if (PictureLogo == TRUE){ - + if (PictureLogo == TRUE){ PictureListCtrlPtr->SetItem(longSelected, 0, _("Picture")); } else { @@ -326,7 +325,8 @@ void frmContactEditorPicture::SetEditorMode(bool EditMode) striter = PictureListTypePtr->find(PictureListIndex); - if (striter->first == PictureListIndex){ + if (striter->first == PictureListIndex && + striter != PictureListTypePtr->end()){ strValue = striter->second; @@ -352,7 +352,8 @@ void frmContactEditorPicture::SetEditorMode(bool EditMode) intiter = PictureListPrefPtr->find(PictureListIndex); - if (intiter->first == PictureListIndex && intiter->second > 0){ + if (intiter->first == PictureListIndex && intiter->second > 0 && + intiter != PictureListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();