From 074e2db3331d35762f1d2dcf06d98f15200fc225 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 5 Sep 2017 21:29:57 +0100 Subject: [PATCH] frmContactEditor: Stop XAB crashing when pressing Modify/Delete XAB crashes after adding an item, deselecting it from the list and then clicking on either of the Modify or Delete buttons. --- source/contacteditor/frmContactEditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/contacteditor/frmContactEditor.cpp b/source/contacteditor/frmContactEditor.cpp index 444b748..4856537 100644 --- a/source/contacteditor/frmContactEditor.cpp +++ b/source/contacteditor/frmContactEditor.cpp @@ -223,14 +223,14 @@ bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected); - if (*longSelected == -1){ return FALSE; - } else { - return TRUE; } + *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected); + + return TRUE; + } void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map* MapData){ -- 2.39.5