diff options
author | Chen Bin <chenbin@uniontech.com> | 2021-10-12 11:19:34 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-12 06:38:49 +0000 |
commit | 31c673d134d728df3f6d802f92c6cd191efee83f (patch) | |
tree | f9baec8690645720767917db20235bdd971055ab | |
parent | fe78a43aef786cdf425e4978d7b22edc7a961ccf (diff) | |
download | qttools-31c673d134d728df3f6d802f92c6cd191efee83f.tar.gz |
qdoc: Fix static analysis error
The `parent` variable may be a null pointer, requiring an additional
judgment.
Change-Id: I0d226d527643a5193c216ce000804ab974f7ffb8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 77d79ef34ea1547a15769ee0b550b96a2c9efcce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 2 |
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; |