From 728b1c28cca2a7472f3d979ecafcc697157664a6 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 10 Feb 2016 00:05:51 +0000 Subject: [PATCH] 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. --- source/contacteditor/frmContactEditorPicture.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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(); -- 2.39.5