summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-27 16:03:51 -0400
committerBrad King <brad.king@kitware.com>2014-05-27 16:11:04 -0400
commit326d15a3294e3b43de534130a4b655ddb454fbfb (patch)
tree13756dcc66349b7aa5cdeac66b4c8f83bc8d51dd
parentcbc9a9514d0dd00b35b3de694dab02a387ec2b52 (diff)
downloadcmake-326d15a3294e3b43de534130a4b655ddb454fbfb.tar.gz
cmake: Tolerate missing HELPSTRING on compiler change
Teach cmake::HandleDeleteCacheVariables to tolerate a missing HELPSTRING (NULL pointer) when saving cache entries. In the absence of other bugs this should not be possible, but avoid the crash just in case.
-rw-r--r--Source/cmake.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index abbabe7627..4f14d73e13 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1231,7 +1231,10 @@ int cmake::HandleDeleteCacheVariables(const char* var)
if(ci.Find(save.key.c_str()))
{
save.type = ci.GetType();
- save.help = ci.GetProperty("HELPSTRING");
+ if(const char* help = ci.GetProperty("HELPSTRING"))
+ {
+ save.help = help;
+ }
}
saved.push_back(save);
}