diff options
Diffstat (limited to 'src/xml.cc')
| -rw-r--r-- | src/xml.cc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -62,9 +62,14 @@ XMLNode::string_node (string name) xmlpp::Node* node = xml_node (name); xmlpp::Node::NodeList c = node->get_children (); - if (c.size() != 1) { + + if (c.size() > 1) { throw XMLError ("unexpected content in XML node"); } + + if (c.empty ()) { + return ""; + } xmlpp::ContentNode const * v = dynamic_cast<xmlpp::ContentNode const *> (c.front()); if (!v) { |
