Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f97f87f

Browse files
committed
(issue BehaviorTree#163) fix ded code
1 parent 4f30e3a commit f97f87f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/xml_parsing.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,13 @@ void VerifyXML(const std::string& xml_text,
321321
}
322322
else if (StrEqual(name, "SubTree"))
323323
{
324-
for (auto child = node->FirstChildElement(); child != nullptr;
325-
child = child->NextSiblingElement())
324+
auto child = node->FirstChildElement();
325+
326+
if (child)
326327
{
327-
if( StrEqual(child->Name(), "remap") )
328+
if (StrEqual(child->Name(), "remap"))
328329
{
329-
ThrowError(node->GetLineNum(), "<remap> was deprecated");
330+
ThrowError(node->GetLineNum(), "<remap> was deprecated");
330331
}
331332
else{
332333
ThrowError(node->GetLineNum(), "<SubTree> should not have any child");

0 commit comments

Comments
 (0)