From 5690cafd6289431c8eb150402478fec4129068d3 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 9 Jan 2009 12:56:09 -0500 Subject: [PATCH] ENH: fix crash for old style scripts --- Source/cmCTest.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cbead3c5b..dbb23df5a 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1317,8 +1317,14 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) { cmCTestScriptHandler* ch = static_cast(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 << "\n";