Create children node in ASTJsonConverter when neccesary

This commit is contained in:
Alex Beregszaszi 2017-08-17 02:13:16 +01:00
parent e3f90565d8
commit 4b56829ac3

View File

@ -91,11 +91,19 @@ void ASTJsonConverter::setJsonNode(
))
{
if (e.second.isObject())
{
if (!m_currentValue["children"].isArray())
m_currentValue["children"] = Json::arrayValue;
appendMove(m_currentValue["children"], std::move(e.second));
}
if (e.second.isArray())
for (auto& child: e.second)
if (!child.isNull())
{
if (!m_currentValue["children"].isArray())
m_currentValue["children"] = Json::arrayValue;
appendMove(m_currentValue["children"], std::move(child));
}
}
else
{