From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:08:53 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorSound in Edit mode. X-Git-Tag: release-0.09~20 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=inline;h=dfe463ca2355e7e12cf0259c334dd55d1e9589d7;p=xestiaab%2F.git Fixed potential crash with frmContactEditorSound 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/frmContactEditorSound.cpp b/source/contacteditor/frmContactEditorSound.cpp index 4e873f1..3c92b7c 100644 --- a/source/contacteditor/frmContactEditorSound.cpp +++ b/source/contacteditor/frmContactEditorSound.cpp @@ -331,8 +331,9 @@ void frmContactEditorSound::SetEditorMode(bool EditMode) intiter = SoundListPrefPtr->find(SoundListIndex); - if (intiter->first == SoundListIndex && intiter->second > 0){ - + if (intiter->first == SoundListIndex && intiter->second > 0 && + intiter != SoundListPrefPtr->end()){ + sliPriority->SetValue(intiter->second); sliPriority->Enable(); chkUsePref->SetValue(TRUE);