CTest: Fix crash when variables are not defined
Avoiding dereference of NULL pointers is always good.
This commit is contained in:
parent
731d61d8d9
commit
7041cd6a88
|
@ -41,7 +41,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
|
||||||
{
|
{
|
||||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||||
cmSystemTools::CollapseFullPath(
|
cmSystemTools::CollapseFullPath(
|
||||||
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY")).c_str());
|
this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY")).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->Values[ct_SOURCE] )
|
if ( this->Values[ct_SOURCE] )
|
||||||
|
@ -54,7 +54,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
|
||||||
{
|
{
|
||||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||||
cmSystemTools::CollapseFullPath(
|
cmSystemTools::CollapseFullPath(
|
||||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
|
this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )
|
if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )
|
||||||
|
|
Loading…
Reference in New Issue