Переглянути джерело

Merge branch 'server-fix-crash' into release-3.9

Merge-request: !1096
Brad King 8 роки тому
батько
коміт
a7e4d595f9
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      Source/cmServerProtocol.cxx

+ 3 - 1
Source/cmServerProtocol.cxx

@@ -284,7 +284,9 @@ static bool testValue(cmState* state, const std::string& key,
                       std::string& value, const std::string& keyDescription,
                       std::string* errorMessage)
 {
-  const std::string cachedValue = std::string(state->GetCacheEntryValue(key));
+  const char* entry = state->GetCacheEntryValue(key);
+  const std::string cachedValue =
+    entry == nullptr ? std::string() : std::string(entry);
   if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
     setErrorMessage(errorMessage, std::string("\"") + key +
                       "\" is set but incompatible with configured " +