From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:42:02 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorCategory in Edit mode. X-Git-Tag: release-0.09~31 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=sidebyside;h=c652fc6a8c7adb87cd00a96548d2f6275842f9f8;p=xestiaab%2F.git Fixed potential crash with frmContactEditorCategory 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/frmContactEditorCategory.cpp b/source/contacteditor/frmContactEditorCategory.cpp index eba5dad..bf2d4ea 100644 --- a/source/contacteditor/frmContactEditorCategory.cpp +++ b/source/contacteditor/frmContactEditorCategory.cpp @@ -213,7 +213,8 @@ void frmContactEditorCategory::SetEditorMode(bool EditMode) striter = CategoryListTypePtr->find(CategoryListIndex); - if (striter->first == CategoryListIndex){ + if (striter->first == CategoryListIndex && + striter != CategoryListTypePtr->end()){ strValue = striter->second; @@ -237,7 +238,8 @@ void frmContactEditorCategory::SetEditorMode(bool EditMode) intiter = CategoryListPrefPtr->find(CategoryListIndex); - if (intiter->first == CategoryListIndex && intiter->second > 0){ + if (intiter->first == CategoryListIndex && intiter->second > 0 && + intiter != CategoryListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();