BUG: fix crash

This commit is contained in:
Bill Hoffman 2001-05-09 10:13:12 -04:00
parent df5059949d
commit ad2247244d

View File

@ -15,6 +15,7 @@
CPropertyList::CPropertyList() CPropertyList::CPropertyList()
{ {
m_Dirty = false; m_Dirty = false;
m_curSel = -1;
} }
CPropertyList::~CPropertyList() CPropertyList::~CPropertyList()
@ -665,6 +666,10 @@ void CPropertyList::OnRButtonUp( UINT nFlags, CPoint point )
void CPropertyList::OnDelete() void CPropertyList::OnDelete()
{ {
if(m_curSel == -1 || this->GetCount() <= 0)
{
return;
}
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel); CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
pItem->m_Removed = true; pItem->m_Removed = true;
this->DeleteString(m_curSel); this->DeleteString(m_curSel);
@ -673,6 +678,10 @@ void CPropertyList::OnDelete()
void CPropertyList::OnHelp() void CPropertyList::OnHelp()
{ {
if(m_curSel == -1 || this->GetCount() <= 0)
{
return;
}
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel); CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
MessageBox(pItem->m_HelpString); MessageBox(pItem->m_HelpString);
} }