CTest: Fix crash when variables are not defined

Avoiding dereference of NULL pointers is always good.
This commit is contained in:
David Cole 2011-10-14 07:46:01 -04:00
parent 731d61d8d9
commit 7041cd6a88

View File

@ -41,7 +41,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
{
this->CTest->SetCTestConfiguration("BuildDirectory",
cmSystemTools::CollapseFullPath(
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY")).c_str());
this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY")).c_str());
}
if ( this->Values[ct_SOURCE] )
@ -54,7 +54,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
{
this->CTest->SetCTestConfiguration("SourceDirectory",
cmSystemTools::CollapseFullPath(
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
}
if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )