From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:18:10 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorVendor in Edit mode. X-Git-Tag: release-0.09~17 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=3b1da98385debe24001f0432f8d6f674f2710c31;hp=b813f99bbcbdf103f82ece0935419a784f0f51e9;p=xestiaab%2F.git Fixed potential crash with frmContactEditorVendor 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/frmContactEditorVendor.cpp b/source/contacteditor/frmContactEditorVendor.cpp index 4696a9d..ce56648 100644 --- a/source/contacteditor/frmContactEditorVendor.cpp +++ b/source/contacteditor/frmContactEditorVendor.cpp @@ -67,7 +67,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListElementPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListElementPtr->end()){ strValue = striter->second; @@ -81,7 +82,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListPtr->end()){ strValue = striter->second;