mirror of
https://github.com/reactos/CMake.git
synced 2024-12-04 17:56:26 +00:00
server: Fix crash on missing cache entries
Test for nullptr before constructing std::string.
This commit is contained in:
parent
f15cfd891d
commit
70272f3c36
@ -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 " +
|
||||
|
Loading…
Reference in New Issue
Block a user