Commit ee79d7a1 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'server-fix-crash'

70272f3c server: Fix crash on missing cache entries
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1096
parents 973ee660 70272f3c
......@@ -289,7 +289,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 " +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment