diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-17 09:13:16 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-21 23:28:30 +0800 |
commit | 4b56829ac3dc28ea9ca6945fee22963149bcc2bd (patch) | |
tree | 5b1a73cf130e8dfd8f6bec3851263d4ebceebaa7 /libsolidity | |
parent | e3f90565d8f623537072d84316d476343c2b06ad (diff) | |
download | dexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.tar.gz dexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.tar.zst dexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.zip |
Create children node in ASTJsonConverter when neccesary
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index fdec8945..6d541803 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -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 { |