Skip to content

Commit 50a291a

Browse files
committed
Fix parent elements in config XML files not closing in a new line
1 parent a11dca5 commit 50a291a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/ConfigurationManager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ void ConfigurationItem::ToXML(XMLElement* elem) {
7878
child->ToXML(element);
7979
}
8080

81-
XMLText* newText = elem->GetDocument()->NewText(value.c_str());
82-
element->InsertEndChild(newText);
81+
if (children.empty() || !value.empty()) {
82+
XMLText* newText = elem->GetDocument()->NewText(value.c_str());
83+
element->InsertEndChild(newText);
84+
}
8385
}
8486

8587
int ConfigurationItem::EnumerateProperties(std::vector<ConfigurationItem*>& outList) {

0 commit comments

Comments
 (0)