diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-09-11 19:13:32 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-09-11 19:13:32 (GMT) |
commit | 9ec133d428a2c7c8a11c8be9b575da18ec281fed (patch) | |
tree | 9f43c7d6c5bb97fa26ef3ac51db5e74e8f50d50d /Source/CursesDialog | |
parent | 2ca71beb2a480e75be4443e1bf425afdc5edc973 (diff) | |
download | CMake-9ec133d428a2c7c8a11c8be9b575da18ec281fed.zip CMake-9ec133d428a2c7c8a11c8be9b575da18ec281fed.tar.gz CMake-9ec133d428a2c7c8a11c8be9b575da18ec281fed.tar.bz2 |
Fix bug in ccmake which made it crash when all cache values were deleted
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 0db7ba0..b32e860 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -449,8 +449,11 @@ void cmCursesMainForm::UpdateStatusBar() // Get the key of the current entry FIELD* cur = current_field(m_Form); int index = field_index(cur); - cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr( - m_Fields[index-2])); + cmCursesWidget* lbl = 0; + if ( index >= 0 ) + { + lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(m_Fields[index-2])); + } char help[128] = ""; const char* curField = ""; if ( lbl ) |