summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-01-09 17:56:09 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-01-09 17:56:09 (GMT)
commit5690cafd6289431c8eb150402478fec4129068d3 (patch)
treee3d32fe4ec9607b9261858687e7e2ca345d13ea4 /Source/cmCTest.cxx
parent5d5fd641c30770ad195748d4fe0fe65c60c40f9c (diff)
downloadCMake-5690cafd6289431c8eb150402478fec4129068d3.zip
CMake-5690cafd6289431c8eb150402478fec4129068d3.tar.gz
CMake-5690cafd6289431c8eb150402478fec4129068d3.tar.bz2
ENH: fix crash for old style scripts
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index cbead3c..dbb23df 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1317,8 +1317,14 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
{
cmCTestScriptHandler* ch =
static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
- const char* subproject =
- ch->GetCMake()->GetProperty("SubProject", cmProperty::GLOBAL);
+ cmake* cm = ch->GetCMake();
+ // if no CMake then this is the old style script and props like
+ // this will not work anyway.
+ if(!cm)
+ {
+ return;
+ }
+ const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
if(subproject)
{
ostr << "<Subproject name=\"" << subproject << "\">\n";