File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -543,15 +543,23 @@ void VerifyXML(const std::string& xml_text,
543543 }
544544 if (name == " ReactiveSequence" )
545545 {
546- const std::string child_name = node->FirstChildElement ()->Name ();
547- const auto child_search = registered_nodes.find (child_name);
548- auto child_type = child_search->second ;
549- if (child_type == NodeType::CONTROL &&
550- ((child_name == " ThreadedAction" ) || (child_name == " StatefulActionNode" ) ||
551- (child_name == " CoroActionNode" ) || (child_name == " AsyncSequence" )))
546+ size_t async_count = 0 ;
547+ for (auto child = node->FirstChildElement (); child != nullptr ;
548+ child = child->NextSiblingElement ())
552549 {
553- ThrowError (line_number, std::string (" The first child of a ReactiveSequence "
554- " cannot be asynchronous" ));
550+ const std::string child_name = node->FirstChildElement ()->Name ();
551+ const auto child_search = registered_nodes.find (child_name);
552+ auto child_type = child_search->second ;
553+ if (child_type == NodeType::CONTROL &&
554+ ((child_name == " ThreadedAction" ) || (child_name == " StatefulActionNode" ) ||
555+ (child_name == " CoroActionNode" ) || (child_name == " AsyncSequence" )))
556+ {
557+ ++async_count;
558+ if (async_count > 1 )
559+ {
560+ ThrowError (line_number, std::string (" A ReactiveSequence cannot have more than one async child." ));
561+ }
562+ }
555563 }
556564 }
557565 }
You can’t perform that action at this time.
0 commit comments