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:20 +0000 |
commit | 419a0d3e6760cc8318dff6e417281e945662c4ee (patch) | |
tree | 48cfd69a83c24e098203df965a4e6c98453257e9 | |
parent | a66058d1155902fc09d832cac2d0e7f52e95aa0b (diff) | |
download | qttools-419a0d3e6760cc8318dff6e417281e945662c4ee.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); |