summaryrefslogtreecommitdiff
path: root/src/xml.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml.cc')
-rw-r--r--src/xml.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xml.cc b/src/xml.cc
index 72dfe1bb..206cb5f0 100644
--- a/src/xml.cc
+++ b/src/xml.cc
@@ -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) {