summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/DocumentHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/parser/stack/DocumentHandler.cpp')
-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) {