mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
presets: Avoid string conversion on bad "name" type
This commit is contained in:
@@ -42,7 +42,10 @@ std::string getPresetName(cmJSONState* state)
|
|||||||
{
|
{
|
||||||
Json::Value const* preset = getPreset(state);
|
Json::Value const* preset = getPreset(state);
|
||||||
if (preset && preset->isMember("name")) {
|
if (preset && preset->isMember("name")) {
|
||||||
return preset->operator[]("name").asString();
|
Json::Value const& name = preset->operator[]("name");
|
||||||
|
if (name.isConvertibleTo(Json::ValueType::stringValue)) {
|
||||||
|
return name.asString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version":6,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": [],
|
||||||
|
"cacheVariables": {
|
||||||
|
"": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user