summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-04-01 12:24:23 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-04-04 08:19:26 +0000
commit06d77c778a1b8f785ec85f05d52e589f02a2d050 (patch)
tree912c402c33825c58752515c1469ff5e72d9acf3e /src
parentc88bf0f65be236b47dc620bf154a7b22eb888034 (diff)
Report a parse error if we didn't manage to create a root element
Subsequent code expects there to be one. Change-Id: I17cdf1d10144fdd4cfcc9863966f404cdf949dca Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/scxml/qscxmlparser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scxml/qscxmlparser.cpp b/src/scxml/qscxmlparser.cpp
index b26471a..f342c12 100644
--- a/src/scxml/qscxmlparser.cpp
+++ b/src/scxml/qscxmlparser.cpp
@@ -2395,8 +2395,8 @@ void QScxmlParserPrivate::parse()
break;
}
}
- if (m_reader->hasError()
- && m_reader->error() != QXmlStreamReader::PrematureEndOfDocumentError) {
+ if (m_reader->hasError() && (m_reader->error() != QXmlStreamReader::PrematureEndOfDocumentError
+ || !m_doc->root)) {
addError(QStringLiteral("Error parsing SCXML file: %1").arg(m_reader->errorString()));
}
}