allow Null Member

Makes Member easier to work with.
This commit is contained in:
Michael Davidsaver
2020-06-25 17:26:02 -07:00
parent 73314e5f35
commit 9f9f038055
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -126,6 +126,8 @@ void Member::Helper::node_validate(const Member* parent, const std::string& id,
{
if(!id.empty() && code.scalarOf()!=TypeCode::Struct && code.scalarOf()!=TypeCode::Union)
throw std::logic_error("Only Struct or Union may have an ID");
else if(!code.valid())
throw std::logic_error("Invalid TypeCode");
if(parent) {
auto c = parent->code.scalarOf();
if(c!=TypeCode::Struct && c!=TypeCode::Union)