Skip to content

Commit be46ca6

Browse files
Fixing yaml parsing to check for empty fields
1 parent 30ce936 commit be46ca6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Src/runcpp2/ParseUtil.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,15 @@ bool runcpp2::ResolveYAML_Stream( ryml::Tree& rootTree,
287287
bool runcpp2::ExistAndHasChild(const ryml::ConstNodeRef& node, const std::string& childName)
288288
{
289289
if(node.num_children() > 0 && node.has_child(childName.c_str()))
290+
{
291+
if(node[childName.c_str()].has_val())
292+
{
293+
if(node[childName.c_str()].val_is_null() || node[childName.c_str()].val().empty())
294+
return false;
295+
}
296+
290297
return true;
298+
}
291299

292300
return false;
293301
}

0 commit comments

Comments
 (0)