Prechádzať zdrojové kódy

Add more error checking

Andy Cedilnik 23 rokov pred
rodič
commit
6a2174ff9d
1 zmenil súbory, kde vykonal 9 pridanie a 1 odobranie
  1. 9 1
      Source/cmCacheManager.cxx

+ 9 - 1
Source/cmCacheManager.cxx

@@ -410,7 +410,15 @@ bool cmCacheManager::SaveCache(const char* path)
       std::string key;
       std::string rkey = i.GetName();
       std::string helpstring;
-      helpstring = i.GetProperty("HELPSTRING");
+      const char* hs = i.GetProperty("HELPSTRING")
+      if ( hs )
+        {
+        helpstring = i.GetProperty("HELPSTRING");
+        }
+      else
+        {
+        helpstring = "";
+        }
       cmCacheManager::OutputHelpString(fout, helpstring.c_str());
       // support : in key name by double quoting 
       if(rkey.find(':') != std::string::npos ||