mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-18 17:31:57 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user