Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed potential crash with frmContactEditorIM in Edit mode.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 9 Feb 2016 23:51:30 +0000 (23:51 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 9 Feb 2016 23:51:30 +0000 (23:51 +0000)
This would be caused because no checks were made on the iterator to see
if it was valid or not.

source/contacteditor/frmContactEditorIM.cpp

index 40bfef1..9d22d94 100644 (file)
@@ -300,8 +300,17 @@ void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType)
                
                }
                
-               strIMUser = IMListPtr->find(IMListIndex)->second;
-               strIMType = IMListTypeInfoPtr->find(IMListIndex)->second;
+               if (IMListPtr->find(IMListIndex) != IMListPtr->end()){
+                 
+                       strIMUser = IMListPtr->find(IMListIndex)->second;
+               
+               }
+               
+               if (IMListTypeInfoPtr->find(IMListIndex) != IMListTypeInfoPtr->end()){
+
+                       strIMType = IMListTypeInfoPtr->find(IMListIndex)->second;
+               
+               }
                
                if (strIMType == wxT("aim")){
                
@@ -348,7 +357,8 @@ void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType)
                
                intiter = IMListPrefPtr->find(IMListIndex);
                
-               if (intiter->first == IMListIndex && intiter->second > 0){
+               if (intiter->first == IMListIndex && intiter->second > 0 &&
+                       intiter != IMListPrefPtr->end()){
                
                        sliPriority->SetValue(intiter->second);
                        sliPriority->Enable();
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy