Browse Source

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.
Brad King 11 years ago
parent
commit
326d15a329
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/cmake.cxx

+ 4 - 1
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);
     }