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.
This commit is contained in:
Brad King 2014-05-27 16:03:51 -04:00
parent cbc9a9514d
commit 326d15a329
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}