summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/PropertyList.cpp
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-05-09 14:13:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-05-09 14:13:12 (GMT)
commitad2247244de305ab3c8b102dba7643ea704756fa (patch)
treee98acf10abe9887d680ad862a163340cf0b0d9ce /Source/MFCDialog/PropertyList.cpp
parentdf5059949db1e9b5e954300abbb8a1729b429991 (diff)
downloadCMake-ad2247244de305ab3c8b102dba7643ea704756fa.zip
CMake-ad2247244de305ab3c8b102dba7643ea704756fa.tar.gz
CMake-ad2247244de305ab3c8b102dba7643ea704756fa.tar.bz2
BUG: fix crash
Diffstat (limited to 'Source/MFCDialog/PropertyList.cpp')
-rw-r--r--Source/MFCDialog/PropertyList.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/MFCDialog/PropertyList.cpp b/Source/MFCDialog/PropertyList.cpp
index 102c828..1e5f13b 100644
--- a/Source/MFCDialog/PropertyList.cpp
+++ b/Source/MFCDialog/PropertyList.cpp
@@ -15,6 +15,7 @@
CPropertyList::CPropertyList()
{
m_Dirty = false;
+ m_curSel = -1;
}
CPropertyList::~CPropertyList()
@@ -665,6 +666,10 @@ void CPropertyList::OnRButtonUp( UINT nFlags, CPoint point )
void CPropertyList::OnDelete()
{
+ if(m_curSel == -1 || this->GetCount() <= 0)
+ {
+ return;
+ }
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
pItem->m_Removed = true;
this->DeleteString(m_curSel);
@@ -673,6 +678,10 @@ void CPropertyList::OnDelete()
void CPropertyList::OnHelp()
{
+ if(m_curSel == -1 || this->GetCount() <= 0)
+ {
+ return;
+ }
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
MessageBox(pItem->m_HelpString);
}