diff options
-rw-r--r-- | tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp index 054fd69..cf85486 100644 --- a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp +++ b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp @@ -53,7 +53,6 @@ LoadingModel::LoadingModel(const Node::Vector &content, const QXmlNamePool &np) : QSimpleXmlNodeModel(np) , m_nodes(content) { - Q_ASSERT(!content.isEmpty()); /* foreach(const Node *n, content) qDebug() << "this:" << n @@ -354,6 +353,11 @@ QAbstractXmlNodeModel::Ptr LoadingModel::create(const QXmlNamePool &np) { Loader loader(np); loader.load(); + if (loader.m_result.isEmpty()) { + qWarning("%s: attempt to create model with no content", Q_FUNC_INFO); + return Ptr(0); + } + return Ptr(new LoadingModel(loader.m_result, np)); } #endif //QTEST_XMLPATTERNS |