diff options
author | Robin Gareus <robin@gareus.org> | 2019-11-01 15:39:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-11-01 15:39:44 +0100 |
commit | 7852047dca6312a668edb1ba3fd0d315b3f83ac8 (patch) | |
tree | 167c712dd8c8ec43c12fc7a69969f52f04c01240 /libs/pbd/xml++.cc | |
parent | eca27d82189c7509f7d010adad9ed3d83bccbf21 (diff) |
Fix XML-writer edge-case (empty content)
Diffstat (limited to 'libs/pbd/xml++.cc')
-rw-r--r-- | libs/pbd/xml++.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 6548852917..95fb370b04 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -482,6 +482,12 @@ XMLNode::attribute_value() XMLNode* XMLNode::add_content(const string& c) { + if (c.empty ()) { + /* this would add a "</>" child, leading to invalid XML. + * Also in XML, empty string content is equivalent to no content. + */ + return NULL; + } return add_child_copy(XMLNode (string(), c)); } |