summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Bin <chenbin@uniontech.com>2021-10-12 11:19:34 +0800
committerChen Bin <chenbin@uniontech.com>2021-10-12 13:49:04 +0800
commit77d79ef34ea1547a15769ee0b550b96a2c9efcce (patch)
treebad42fdbcb63d2bb137ce2acc05ed03dc16a7b97
parent0454ee0a158652f1913e29117ee495b93a67ad29 (diff)
qdoc: Fix static analysis error
The `parent` variable may be a null pointer, requiring an additional judgment. Pick-to: 6.2 Change-Id: I0d226d527643a5193c216ce000804ab974f7ffb8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--src/qdoc/qdocindexfiles.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index b37323885..3ff4ecb8c 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -216,7 +216,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader &reader, Node *current,
return (name == relatedNode->name() && href == relatedNode->url().section(QLatin1Char('/'), -1));
});
- if (nodeIterator != m_relatedNodes.end()) {
+ if (nodeIterator != m_relatedNodes.end() && parent) {
parent->adoptChild(*nodeIterator);
reader.skipCurrentElement();
return;