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 08:17:19 +0000 |
commit | 05f23a21db806db7217eecd0c1e44d32225d5a7a (patch) | |
tree | a6f0e71a71d5bd75076e849430a1129514bd6771 | |
parent | ccd6bbd9e23d9dc3ceb35b4dc7ed87d94182cc43 (diff) | |
download | qttools-05f23a21db806db7217eecd0c1e44d32225d5a7a.tar.gz |
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 d09479df0..8befa6642 100644 --- a/src/qdoc/webxmlgenerator.cpp +++ b/src/qdoc/webxmlgenerator.cpp @@ -753,7 +753,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); |