summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-18 14:17:44 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-18 14:17:44 +0100
commite4aa28fc9bd606a0a2aa9be75a3bef6ad3b6fed7 (patch)
tree11fd301cfffafaed7aaa33863e783ffe633df809 /src/core
parentb74a054bd7e7538594824445a0bc666ebb337689 (diff)
fixed a bug with doubled root nodes.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/parser/stack/DocumentHandler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp
index 1df3cb3..98b84c7 100644
--- a/src/core/parser/stack/DocumentHandler.cpp
+++ b/src/core/parser/stack/DocumentHandler.cpp
@@ -142,6 +142,14 @@ bool DocumentChildHandler::start(Variant::mapType &args)
Rooted<StructuredEntity> entity;
// handle the root note specifically.
if (parentNode->isa(&RttiTypes::Document)) {
+ // if we already have a root node, stop.
+ if (parentNode.cast<Document>()->getRoot() != nullptr) {
+ logger().warning(
+ "This document already has a root node. The additional "
+ "node is ignored.",
+ location());
+ return false;
+ }
Rooted<StructuredClass> strct = scope().resolve<StructuredClass>(
Utils::split(name(), ':'), logger());
if (strct == nullptr) {