summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarian Beermann <public@enkore.de>2014-10-07 11:43:13 +0200
committerMarian Beermann <public@enkore.de>2014-10-07 23:08:18 +0200
commit264fcd4eefef34cd764ac8be99feb3b31bc03004 (patch)
treefdacf40c81cf3569edfe01aedd55ba1db5614828 /src
parent1cc079c29b68d08b5c83c5a323fb0512cb7bb0db (diff)
Fix QDomDocument::importNode() crashing on null nodes
Task-number: QTBUG-12927 Change-Id: I597a149bb273fa132fdb34e3678ebc3069d6f516 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/xml/dom/qdom.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 1fcbe607e4..9068830c4b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -7035,6 +7035,9 @@ QDomNodeList QDomDocument::elementsByTagName(const QString& tagname) const
import QDomDocument and QDomDocumentType nodes. In those cases
this function returns a \l{QDomNode::isNull()}{null node}.
+ If \a importedNode is a \l{QDomNode::isNull()}{null node},
+ a null node is returned.
+
If \a deep is true, this function imports not only the node \a
importedNode but its whole subtree; if it is false, only the \a
importedNode is imported. The argument \a deep has no effect on
@@ -7093,6 +7096,8 @@ QDomNodeList QDomDocument::elementsByTagName(const QString& tagname) const
*/
QDomNode QDomDocument::importNode(const QDomNode& importedNode, bool deep)
{
+ if (importedNode.isNull())
+ return QDomNode();
if (!impl)
impl = new QDomDocumentPrivate();
return QDomNode(IMPL->importNode(importedNode.impl, deep));