From 326d15a3294e3b43de534130a4b655ddb454fbfb Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 27 May 2014 16:03:51 -0400 Subject: [PATCH] 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. --- Source/cmake.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index abbabe762..4f14d73e1 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); }