diff options
author | JiDe Zhang <zhangjide@uniontech.com> | 2021-03-12 16:59:42 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-18 09:17:21 +0000 |
commit | 64651d862af266f0c39b60eec44e21aa52668f92 (patch) | |
tree | 90a91f836bdb94b589c085fdb050662aa9a17f56 | |
parent | c49704dd7cded03cc9355c86bd3c2fcf9eeaf64e (diff) |
QDoc: Fix possible crash in WebXMLGenerator
In the at WebXMLGenerator::startLink, the "atom" argument
maybe is nullptr.
Fixes: QTBUG-91754
Change-Id: Ie97607ab9a1afc9f0df632b0448aa3294679180c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit f4861c9a5aba08b13ec77cc5a6c754a08311db02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/webxmlgenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/webxmlgenerator.cpp b/src/qdoc/webxmlgenerator.cpp index f75aabee6..7dd46c134 100644 --- a/src/qdoc/webxmlgenerator.cpp +++ b/src/qdoc/webxmlgenerator.cpp @@ -748,7 +748,7 @@ void WebXMLGenerator::startLink(QXmlStreamWriter &writer, const Atom *atom, cons fullName = node->fullName(); if (!fullName.isEmpty() && !link.isEmpty()) { writer.writeStartElement("link"); - if (!atom->string().isEmpty()) + if (atom && !atom->string().isEmpty()) writer.writeAttribute("raw", atom->string()); else writer.writeAttribute("raw", fullName); |