From e0bdcf1fc44f74cda0a8a0fe5323129eb3f09fb4 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Mon, 4 Jun 2012 09:48:05 +0200 Subject: QDoc: check if !isNull() before casting prev/next nodes. Change-Id: Ifac095ef0af0b483fbf53c6a18cf3c3130d37710 Reviewed-by: Martin Smith --- src/tools/qdoc/ditaxmlgenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 9bb64d41ef..a9182c2231 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -2414,7 +2414,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke if (node->links().contains(Node::PreviousLink)) { linkPair = node->links()[Node::PreviousLink]; linkNode = findNodeForTarget(linkPair.first, node, marker); - if (linkNode->type() == Node::Fake) { + if (linkNode && linkNode->type() == Node::Fake) { const FakeNode *fakeNode = static_cast(linkNode); linkPair.second = fakeNode->title(); } @@ -2423,7 +2423,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke if (node->links().contains(Node::NextLink)) { linkPair = node->links()[Node::NextLink]; linkNode = findNodeForTarget(linkPair.first, node, marker); - if (linkNode->type() == Node::Fake) { + if (linkNode && linkNode->type() == Node::Fake) { const FakeNode *fakeNode = static_cast(linkNode); linkPair.second = fakeNode->title(); } @@ -2432,7 +2432,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke if (node->links().contains(Node::StartLink)) { linkPair = node->links()[Node::StartLink]; linkNode = findNodeForTarget(linkPair.first, node, marker); - if (linkNode->type() == Node::Fake) { + if (linkNode && linkNode->type() == Node::Fake) { const FakeNode *fakeNode = static_cast(linkNode); linkPair.second = fakeNode->title(); } -- cgit v1.2.3