Fix problem with ccmake crashing on empty caches
This commit is contained in:
parent
c41fe4f179
commit
2ca71beb2a
@ -451,11 +451,14 @@ void cmCursesMainForm::UpdateStatusBar()
|
|||||||
int index = field_index(cur);
|
int index = field_index(cur);
|
||||||
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(
|
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(
|
||||||
m_Fields[index-2]));
|
m_Fields[index-2]));
|
||||||
const char* curField = lbl->GetValue();
|
char help[128] = "";
|
||||||
|
const char* curField = "";
|
||||||
|
if ( lbl )
|
||||||
|
{
|
||||||
|
curField = lbl->GetValue();
|
||||||
|
|
||||||
// Get the help string of the current entry
|
// Get the help string of the current entry
|
||||||
// and add it to the help string
|
// and add it to the help string
|
||||||
char help[128];
|
|
||||||
cmCacheManager::CacheIterator it =
|
cmCacheManager::CacheIterator it =
|
||||||
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator(curField);
|
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator(curField);
|
||||||
if (!it.IsAtEnd())
|
if (!it.IsAtEnd())
|
||||||
@ -475,7 +478,7 @@ void cmCursesMainForm::UpdateStatusBar()
|
|||||||
{
|
{
|
||||||
sprintf(help," ");
|
sprintf(help," ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Join the key, help string and pad with spaces
|
// Join the key, help string and pad with spaces
|
||||||
// (or truncate) as necessary
|
// (or truncate) as necessary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user